More elegant way to force class initialization
This commit is contained in:
parent
6205f79554
commit
7bc91c00d9
|
@ -30,14 +30,9 @@ import org.elasticsearch.script.ScriptModule;
|
||||||
*/
|
*/
|
||||||
public final class PainlessPlugin extends Plugin {
|
public final class PainlessPlugin extends Plugin {
|
||||||
|
|
||||||
// parse our definition at startup (not on the user's first script)
|
// force to pare our definition at startup (not on the user's first script)
|
||||||
// compilation process is sandboxed and has no file access.
|
|
||||||
static {
|
static {
|
||||||
try {
|
Definition.voidType.hashCode();
|
||||||
Class.forName("org.elasticsearch.painless.Definition");
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue