Changeset 13221 for trunk/abcl/src/org


Ignore:
Timestamp:
02/14/11 23:03:12 (11 years ago)
Author:
astalla
Message:

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

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Java.java

    r13213 r13221  
    9292
    9393        {
    94             // FIXME Verify that CONDITION-SYMBOL is a symbol that names a condition.
     94            LispClass lispClass = (LispClass) LispClass.findClass(symbol, true);
    9595            // FIXME Signal a continuable error if the exception is already registered.
    96             if ((symbol instanceof Symbol) && isJavaException(LispClass.findClass((Symbol) symbol))) {
     96            if (isJavaException(lispClass)) {
    9797                registeredExceptions.put(classForName(className.getStringValue()),
    9898                                         (Symbol)symbol);
     
    123123    };
    124124
    125     static Symbol getCondition(Class cl)
    126     {
    127   Class o = classForName("java.lang.Object");
    128       for (Class c = cl ; c != o ; c = c.getSuperclass()) {
     125    static Symbol getCondition(Class cl) {
     126        Class o = classForName("java.lang.Object");
     127        for (Class c = cl ; c != o ; c = c.getSuperclass()) {
    129128            Object object = registeredExceptions.get(c);
    130             if (object != null && isJavaException(LispClass.findClass((Symbol) object))) {
    131                 return (Symbol) object;
     129            if (object instanceof Symbol) {
     130                LispClass lispClass = (LispClass) LispClass.findClass((Symbol) object, true);
     131                if(isJavaException(lispClass)) {
     132                    return (Symbol) object;
     133                }
    132134            }
    133135        }
  • trunk/abcl/src/org/armedbear/lisp/LispClass.java

    r12956 r13221  
    288288  public boolean subclassp(LispObject obj)
    289289  {
    290     return false;
     290      return subclassp(this, obj);
    291291  }
    292292
     
    306306        cpl = ((Cons)cpl).cdr;
    307307      }
    308 
    309     if (cls instanceof LispClass)
    310       // additional checks (currently because of JavaClass)
    311       return ((LispClass)cls).subclassp(obj);
    312 
    313308    return false;
    314309  }
Note: See TracChangeset for help on using the changeset viewer.