Changeset 11552


Ignore:
Timestamp:
01/09/09 22:16:04 (12 years ago)
Author:
astalla
Message:
  • fixed a bug in print-object (java-class), thanks to logicmoo
  • jproperty-value get/set gives better error messages when it fails
Location:
branches/scripting/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/scripting/j/src/org/armedbear/lisp/Java.java

    r11450 r11552  
    707707        return new JavaObject(pd.getReadMethod().invoke(obj));
    708708      } catch (Exception e) {
    709         ConditionThrowable t = new ConditionThrowable("Exception in accessing property");
     709        ConditionThrowable t = new ConditionThrowable("Exception reading property");
    710710        t.initCause(e);
    711711        throw t;
     
    719719     
    720720      public LispObject execute(LispObject javaObject, LispObject propertyName, LispObject value) throws ConditionThrowable {
    721       try {
    722               Object obj = javaObject.javaInstance();
    723         PropertyDescriptor pd = getPropertyDescriptor(obj, propertyName);
    724         pd.getWriteMethod().invoke(obj, value.javaInstance());
    725         return value;
    726       } catch (Exception e) {
    727         ConditionThrowable t = new ConditionThrowable("Exception in accessing property");
    728         t.initCause(e);
    729         throw t;
    730       }
     721      Object obj = null;
     722      try {
     723    obj = javaObject.javaInstance();
     724    PropertyDescriptor pd = getPropertyDescriptor(obj, propertyName);
     725    pd.getWriteMethod().invoke(obj, value.javaInstance());
     726    return value;
     727      } catch (Exception e) {
     728    ConditionThrowable t = new ConditionThrowable("Exception writing property " + propertyName.writeToString() + " in object " + obj + " to " + value.writeToString());
     729    t.initCause(e);
     730    throw t;
     731      }
    731732        }
    732733    };
  • branches/scripting/j/src/org/armedbear/lisp/print-object.lisp

    r11379 r11552  
    3939
    4040(defmethod print-object ((class java:java-class) stream)
    41   (write-string (%write-to-string object) stream))
     41  (write-string (%write-to-string class) stream))
    4242
    4343(defmethod print-object ((class class) stream)
Note: See TracChangeset for help on using the changeset viewer.