# HG changeset patch # User Christian Wimmer # Date 1356557770 28800 # Node ID 287f97c93de389cc7d0310704dc1bb4abf19d118 # Parent 49bbf004fbb84d8193cbf13ac31cd5297ee7f966 Better assertion error message diff -r 49bbf004fbb8 -r 287f97c93de3 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetInstaller.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetInstaller.java Tue Dec 25 22:59:37 2012 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetInstaller.java Wed Dec 26 13:36:10 2012 -0800 @@ -122,13 +122,13 @@ } Method originalMethod = originalClazz.getDeclaredMethod(originalName, originalParameters); if (!originalMethod.getReturnType().isAssignableFrom(method.getReturnType())) { - throw new RuntimeException("Snippet has incompatible return type"); + throw new RuntimeException("Snippet has incompatible return type: " + method); } int modifiers = method.getModifiers(); if (!Modifier.isStatic(modifiers)) { - throw new RuntimeException("Snippets must be static methods"); + throw new RuntimeException("Snippets must be static methods: " + method); } else if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { - throw new RuntimeException("Snippet must not be abstract or native"); + throw new RuntimeException("Snippet must not be abstract or native: " + method); } ResolvedJavaMethod snippet = runtime.lookupJavaMethod(method); StructuredGraph graph = makeGraph(snippet, inliningPolicy(snippet), true);