# HG changeset patch # User Doug Simon # Date 1428444190 -7200 # Node ID 0c1cd72188dc5ddf554d4a51a316c4809284ae06 # Parent f2a357ee14e42b63d8016eedda1b229593f78f18 fail fast(er) if the target method of an InvocationPlugin does not exist diff -r f2a357ee14e4 -r 0c1cd72188dc graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Tue Apr 07 18:02:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Wed Apr 08 00:03:10 2015 +0200 @@ -213,6 +213,7 @@ if (!isStatic) { argumentTypes[0] = declaringClass; } + assert resolveJava() != null; } @Override @@ -233,16 +234,20 @@ } ResolvedJavaMethod resolve(MetaAccessProvider metaAccess) { + return metaAccess.lookupJavaMethod(resolveJava()); + } + + Executable resolveJava() { try { - ResolvedJavaMethod method; + Executable res; Class[] parameterTypes = isStatic ? argumentTypes : Arrays.copyOfRange(argumentTypes, 1, argumentTypes.length); if (name.equals("")) { - method = metaAccess.lookupJavaMethod(declaringClass.getDeclaredConstructor(parameterTypes)); + res = declaringClass.getDeclaredConstructor(parameterTypes); } else { - method = metaAccess.lookupJavaMethod(declaringClass.getDeclaredMethod(name, parameterTypes)); + res = declaringClass.getDeclaredMethod(name, parameterTypes); } - assert method.isStatic() == isStatic; - return method; + assert Modifier.isStatic(res.getModifiers()) == isStatic; + return res; } catch (NoSuchMethodException | SecurityException e) { throw new GraalInternalError(e); }