[armedbear-cvs] r13221 - in trunk/abcl: . src/org/armedbear/lisp

Alessio Stalla astalla at common-lisp.net
Mon Feb 14 23:03:15 UTC 2011


Author: astalla
Date: Mon Feb 14 18:03:12 2011
New Revision: 13221

Log:
Fix LispClass.subclassp(LispObject) used by register-java-exception. More checks in register-java-exception.


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

Modified: trunk/abcl/pom.xml
==============================================================================
--- trunk/abcl/pom.xml	(original)
+++ trunk/abcl/pom.xml	Mon Feb 14 18:03:12 2011
@@ -13,9 +13,9 @@
   </parent>
   <groupId>org.armedbear.lisp</groupId>
   <artifactId>abcl</artifactId>
+  <version>0.24.0</version>
   <packaging>jar</packaging>
   <name>ABCL - Armed Bear Common Lisp</name>
-  <version>0.24.0</version>
   <description>Common Lisp implementation running on the JVM</description>
   <url>http://common-lisp/project/armedbear</url>
   <licenses>

Modified: trunk/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Java.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Java.java	Mon Feb 14 18:03:12 2011
@@ -91,9 +91,9 @@
         public LispObject execute(LispObject className, LispObject symbol)
 
         {
-            // FIXME Verify that CONDITION-SYMBOL is a symbol that names a condition.
+            LispClass lispClass = (LispClass) LispClass.findClass(symbol, true);
             // FIXME Signal a continuable error if the exception is already registered.
-            if ((symbol instanceof Symbol) && isJavaException(LispClass.findClass((Symbol) symbol))) {
+            if (isJavaException(lispClass)) {
                 registeredExceptions.put(classForName(className.getStringValue()),
                                          (Symbol)symbol);
                 return T;
@@ -122,13 +122,15 @@
         }
     };
 
-    static Symbol getCondition(Class cl)
-    {
-	Class o = classForName("java.lang.Object");
-     	for (Class c = cl ; c != o ; c = c.getSuperclass()) {
+    static Symbol getCondition(Class cl) {
+        Class o = classForName("java.lang.Object");
+        for (Class c = cl ; c != o ; c = c.getSuperclass()) {
             Object object = registeredExceptions.get(c);
-            if (object != null && isJavaException(LispClass.findClass((Symbol) object))) {
-                return (Symbol) object;
+            if (object instanceof Symbol) {
+                LispClass lispClass = (LispClass) LispClass.findClass((Symbol) object, true);
+                if(isJavaException(lispClass)) {
+                    return (Symbol) object;
+                }
             }
         }
         return null;

Modified: trunk/abcl/src/org/armedbear/lisp/LispClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispClass.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispClass.java	Mon Feb 14 18:03:12 2011
@@ -287,7 +287,7 @@
 
   public boolean subclassp(LispObject obj)
   {
-    return false;
+      return subclassp(this, obj);
   }
 
   public static boolean subclassp(LispObject cls, LispObject obj)
@@ -305,11 +305,6 @@
           return true;
         cpl = ((Cons)cpl).cdr;
       }
-
-    if (cls instanceof LispClass)
-      // additional checks (currently because of JavaClass)
-      return ((LispClass)cls).subclassp(obj);
-
     return false;
   }
 




More information about the armedbear-cvs mailing list