Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#229 closed defect (fixed)

JSS method resolution failure

Reported by: Mark Evenson Owned by: Mark Evenson
Priority: critical Milestone: 1.1.0
Component: java Version: 1.1.0-dev
Keywords: jss method-resolution abcl-contrib Cc:
Parent Tickets:

Description

Jonathan Bona reports:

#| 
We found this issue while working with LSW. It seems to be a bug in
how public methods are found for inner classes. The last line of code
below results in an exception rather than finding and running the
size() method:
|#

(require :abcl-contrib)
(require :jss)
(jss::ensure-compatibility)

(setq headers 
      (#"getHeaderFields" 
       (#"openConnection" 
        (jss::new 'java.net.url "http://google.com"))))

; a java.util.Collections$UnmodifiableRandomAccessList
(setq ural 
      (#"get" headers
              (second (jss::set-to-list (#"keySet" headers)))))

;finds:  #<method public int java.util.Collections$UnmodifiableCollection.size()>
(find "size" 
      (#"getMethods" (#"getClass" ural) ) 
      :test 'string-equal :key #"getName")

; Java exception 'java.lang.NoSuchMethodException: No applicable
; method named size found in java.lang.Object or
; java.util.Collections$UnmodifiableRandomAccessList'.
(#"size" ural)


#|
I chased this into org.armedbear.lisp.Java, where findMethod is
returning null.
|#

Change History (5)

comment:1 Changed 8 years ago by Mark Evenson

Version: 1.1.0-dev

comment:2 Changed 8 years ago by Mark Evenson

Confirmed as failing on trunk.

comment:3 Changed 8 years ago by Mark Evenson

Owner: changed from nobody to Mark Evenson
Status: newaccepted

comment:4 Changed 8 years ago by Mark Evenson

Resolution: fixed
Status: acceptedclosed

(In [14239]) Fixes #229 so that JCALL works with static member classes.

Added non-working test to putative JSS test suite.

comment:5 Changed 4 years ago by aruttenberg

fixed the test

Note: See TracTickets for help on using tickets.