Ignore:
Timestamp:
03/23/10 12:59:08 (13 years ago)
Author:
Mark Evenson
Message:

Fix JAVA-OBJECT whose tynot being properly coerced to array of primitive types.

Fix proposed by Douglas Miles.

An array of primitive types which were first stuffed into a
type-erasing Java collection and then retrieved could not be used as
the original type.

Updated JAVA-OBJECT's getParts() protocol to return information about
what type the wrapped object thinks it should be.

Added test BUGS.JAVA.1 to test that this has been fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/test/lisp/abcl/bugs.lisp

    r12417 r12570  
    4040
    4141     
     42(deftest bugs.pathname.1
     43    (namestring (make-pathname :directory '(:relative) :name "file"
     44                   :type :unspecific
     45                   :host nil :device nil))
     46  "./file")
     47
     48(deftest bugs.pathname.2
     49    (TRANSLATE-PATHNAME
     50     #P"/Users/evenson/work/bordeaux-threads/src/bordeaux-threads.abcl"
     51     #P"/**/**/*.*"
     52     #P"/Users/evenson/.cache/common-lisp/armedbear-0.20.0-dev-darwin-unknown/**/*.*")
     53  #P"/Users/evenson/.cache/common-lisp/armedbear-0.20.0-dev-darwin-unknown/bordeaux-threads.abcl")
     54
     55(deftest bugs.pathname.3 
     56    (namestring (MAKE-PATHNAME :HOST NIL :DEVICE NIL
     57                               :DIRECTORY '(:RELATIVE :WILD-INFERIORS)
     58                               :DEFAULTS "/**/"))
     59  "**/")
     60
     61(deftest bugs.java.1
     62    (let* ((a (java:jnew-array "byte" 1))
     63           (b (let ((array-list (java:jnew (java:jconstructor
     64                                       "java.util.ArrayList"))))
     65                (java:jcall (java:jmethod "java.util.AbstractList" "add"
     66                                          "java.lang.Object")
     67                            array-list a)
     68                (java:jcall (java:jmethod "java.util.AbstractList" "get" "int")
     69                            array-list 0))))
     70      (type-of (sys::%make-byte-array-input-stream b)))
     71  stream)
     72               
     73                   
     74                   
Note: See TracChangeset for help on using the changeset viewer.