public Method getReflectMethod(String method, Class... types) { assertNotNull("dynamicCompiler not ready", dynamicCompiler); try { return dynamicCompiler.getMethod(method, types); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } return null; }
void compile(ClassNode cls) { if (!compile) { return; } try { dynamicCompiler = new DynamicCompiler(cls); boolean result = dynamicCompiler.compile(); assertTrue("Compilation failed", result); System.out.println("Compilation: PASSED"); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
public Object invoke(Method mth, Object... args) throws Exception { assertNotNull("dynamicCompiler not ready", dynamicCompiler); assertNotNull("unknown method", mth); return dynamicCompiler.invoke(mth, args); }