[armedbear-cvs] r13365 - trunk/abcl/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Tue Jun 28 15:28:39 UTC 2011


Author: mevenson
Date: Tue Jun 28 08:28:38 2011
New Revision: 13365

Log:
Inform user of missing instance method name.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Java.java

Modified: trunk/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Java.java	Mon Jun 27 03:23:32 2011	(r13364)
+++ trunk/abcl/src/org/armedbear/lisp/Java.java	Tue Jun 28 08:28:38 2011	(r13365)
@@ -45,6 +45,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.text.MessageFormat;
 import java.util.*;
 
 public final class Java
@@ -861,6 +862,10 @@
                 methodArgs = translateMethodArguments(args, 2);
                 method = findMethod(instance, intendedClass, methodName, methodArgs);
                 if (method == null) {
+                    if (intendedClass == null) {
+                        String msg = MessageFormat.format("No instance method named {0} found for type {1}", methodName, instance.getClass().getName());
+                        throw new NoSuchMethodException(msg);
+                    }
                     String classes = intendedClass.getName();
                     Class<?> actualClass = instance.getClass();
                     if(actualClass != intendedClass) {




More information about the armedbear-cvs mailing list