[armedbear-ticket] [armedbear] #229: JSS method resolution failure

armedbear armedbear-devel at common-lisp.net
Wed Aug 1 05:47:51 UTC 2012


#229: JSS method resolution failure
------------------------------------------------+---------------------------
 Reporter:  mevenson                            |       Owner:  nobody
     Type:  defect                              |      Status:  new   
 Priority:  critical                            |   Milestone:  1.1.0 
Component:  java                                |     Version:        
 Keywords:  jss method-resolution abcl-contrib  |  
------------------------------------------------+---------------------------
 [http://article.gmane.org/gmane.lisp.armedbear.devel/2402 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.
 |#
 }}}

-- 
Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/229>
armedbear <http://common-lisp.net/project/armedbear>
armedbear


More information about the armedbear-ticket mailing list