More elegant way to force class initialization

This commit is contained in:
Uwe Schindler 2016-05-20 14:12:15 +02:00
parent 6205f79554
commit 7bc91c00d9
1 changed files with 2 additions and 7 deletions

View File

@ -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