Changeset 13286


Ignore:
Timestamp:
05/22/11 02:18:43 (10 years ago)
Author:
Mark Evenson
Message:

Fix GET-JAVA-FIELD.

Remove unncessary (?) private GENSYM mechanism in INVOKE-RESTARGS for
SYMBOL-MACROLET bug in abcl-0.18, which has a) been fixed with
abcl-0.18.1, and b) is no longer using SYMBOL-MACROLET here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/jss/invoke.lisp

    r13285 r13286  
    224224;; a regular Lisp string as ABCL converts the Java string to a Lisp string.
    225225
    226 
    227 (eval-when (:compile-toplevel :load-toplevel :execute)
    228   (defpackage lambdas (:use))
    229   (defvar *lcount* 0))
    230 
    231226(eval-when (:compile-toplevel :load-toplevel :execute)
    232227  (defun read-invoke (stream char arg)
    233228    (unread-char char stream)
    234229    (let ((name (read stream)))
    235       (let ((object-var (intern (format nil "G~a" (incf *lcount*)) 'lambdas)) ;; work around bug in 0.18 symbol-macrolet
    236             (args-var (intern (format nil "G~a" (incf *lcount*)) 'lambdas)))
     230      (let ((object-var (gensym))
     231            (args-var (gensym)))
    237232        `(lambda (,object-var &rest ,args-var)
    238233           (invoke-restargs ,name  ,object-var ,args-var ,(eql arg 0))))))
     
    332327      (let* ((class (if (symbolp object)
    333328      (setq object (find-java-class object))
    334           (if (equal "java.lang.Class" (jclass-name (jobject-class object)) )
    335         object
    336       (jobject-class object))))
     329                        (if (equal "java.lang.Class" (jclass-name (jobject-class object)))
     330                            object
     331                            (jobject-class object))))
    337332       (jfield (if (java-object-p field)
    338333       field
    339            (find field (#"getDeclaredFields" class) :key 'jfield-name :test 'equal))))
     334                         (find field (#"getDeclaredFields" class)
     335                               :key 'jfield-name :test 'equal))))
    340336  (#"setAccessible" jfield t)
    341337  (values (#"get" jfield object) jfield))
    342     (if (symbolp object)
    343   (let ((class (find-java-class object)))
    344           (jfield class field)
    345         (jfield field object)))))
     338      (if (symbolp object)
     339          (let ((class (find-java-class object)))
     340            (jfield class field))
     341          (jfield field object))))
    346342
    347343;; use #"getSuperclass" and #"getInterfaces" to see whether there are fields in superclasses that we might set
Note: See TracChangeset for help on using the changeset viewer.