An issue in invoke.lisp (below): set-java-field calls the poke and pokeStatic methods from jscheme's jsint.Invoke class. This should be replaced, right?
;;; http://svn.common-lisp.net/armedbear/tags/1.0.1/abcl/contrib/jss/invoke.lisp (defun set-java-field (object field value &optional (try-harder *running-in-osgi*)) (if try-harder (let* ((class (if (symbolp object) (setq object (find-java-class object)) (if (equal "java.lang.Class" (jclass-name (jobject-class object)) ) object (jobject-class object)))) (jfield (if (java-object-p field) field (find field (#"getDeclaredFields" class) :key 'jfield-name :test 'equal)))) (#"setAccessible" jfield t) (values (#"set" jfield object value) jfield)) (if (symbolp object) (let ((class (find-java-class object))) (#"pokeStatic" 'invoke class field value)) (#"poke" 'invoke object field value))))
- Jonathan Bona
On Apr 5, 2012, at 22:52 , Jonathan P. Bona wrote:
An issue in invoke.lisp (below): set-java-field calls the poke and pokeStatic methods from jscheme's jsint.Invoke class. This should be replaced, right?
Yep. This should be fixed in [r13909][1]. I haven't had the time yet to go through the JSS:WITH-CONSTANT-SIGNATURE test yet, but hopefully a bit more time will clear up later this week.
Can you (and Alan) check if you can use the setf'able JAVA:JFIELD value instead of this interface? Or does that not work in OSGi contexts? I think JAVA:JFIELD was added to ABCL after Alan started using SET-JAVA-FIELD/GET-JAVA-FIELD.
[1]: http://trac.common-lisp.net/armedbear/changeset/13909
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
We'll check on jfield. As for OSGI, exploring that is on Jonathan's agenda, so we'll have to report back as we get a handle on how OSGI will be treating us ;-)
Thanks a bunch! -Alan
On Tue, Apr 10, 2012 at 11:09 AM, Mark Evenson evenson@panix.com wrote:
On Apr 5, 2012, at 22:52 , Jonathan P. Bona wrote:
An issue in invoke.lisp (below): set-java-field calls the poke and pokeStatic methods from jscheme's jsint.Invoke class. This should be replaced, right?
Yep. This should be fixed in [r13909][1]. I haven't had the time yet to go through the JSS:WITH-CONSTANT-SIGNATURE test yet, but hopefully a bit more time will clear up later this week.
Can you (and Alan) check if you can use the setf'able JAVA:JFIELD value instead of this interface? Or does that not work in OSGi contexts? I think JAVA:JFIELD was added to ABCL after Alan started using SET-JAVA-FIELD/GET-JAVA-FIELD.
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
armedbear-devel mailing list armedbear-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
armedbear-devel@common-lisp.net