summaryrefslogtreecommitdiff
path: root/test/files/run/indy-via-macro/Bootstrap.java
blob: af4f5dfd4f507ecaca5168f5687a470de7479738 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package test;

import java.lang.invoke.*;
import java.util.regex.Pattern;

public final class Bootstrap {
    private Bootstrap() {
    }

    /** Pre-compile a regex */
    public static CallSite bootstrap(MethodHandles.Lookup lookup, String invokedName,
                                     MethodType invokedType,
                                     String value) throws Throwable {
        return new ConstantCallSite(MethodHandles.constant(Pattern.class, Pattern.compile(value)));
    }
}