Ticket #362: new-jfield-patch.patch

File new-jfield-patch.patch, 1.6 KB (added by Robert Goldman, 10 years ago)

Fix what seems to have been a mistake in my last patch.

  • contrib/jss/invoke.lisp

    diff --git a/contrib/jss/invoke.lisp b/contrib/jss/invoke.lisp
    index 573727e..08b5032 100644
    a b CLASS-NAME may either be a symbol or a string according to the usual JSS convent 
    324324    :reader object
    325325    ))
    326326  (:report (lambda (c stream)
    327              (error 'no-such-java-field :field-name field :object object))))
     327             (format stream "Unable to find a FIELD named ~a for ~a"
     328                     (field-name c) (object c))))
     329  )
    328330
    329331(defun get-java-field (object field &optional (try-harder *running-in-osgi*))
    330332  "Get the value of the FIELD contained in OBJECT.
    If OBJECT is a symbol it names a dot qualified static FIELD." 
    338340             (jfield (if (java-object-p field)
    339341                         field
    340342                         (or (find-declared-field field class)
    341                              (error "Unable to find a FIELD named ~a for ~a"
    342                                     field object)))))
     343                             (error 'no-such-java-field :field-name field :object object)))))
    343344        (#"setAccessible" jfield +true+)
    344345        (values (#"get" jfield object) jfield))
    345346      (if (symbolp object)
    all superclasses of CLASS. 
    364365  (find fieldname (#"getDeclaredFields" class)
    365366        :key 'jfield-name :test 'equal))
    366367
    367 ;; TODO use #"getSuperclass" and #"getInterfaces" to see whether there
    368 ;; are fields in superclasses that we might set
    369368(defun set-java-field (object field value &optional (try-harder *running-in-osgi*))
    370369  "Set the FIELD of OBJECT to VALUE.
    371370If OBJECT is a symbol, it names a dot qualified Java class to look for