changeset 7295:287f97c93de3

Better assertion error message
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 26 Dec 2012 13:36:10 -0800
parents 49bbf004fbb8
children 8d9c7a109967
files graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetInstaller.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);