Ticket #347: jarray-convert.diff

File jarray-convert.diff, 1.0 KB (added by Mark Evenson, 8 years ago)
  • src/org/armedbear/lisp/JavaObject.java

    # HG changeset patch
    # User Mark <evenson@panix.com>
    # Date 1391763396 -3600
    #      Fri Feb 07 09:56:36 2014 +0100
    # Node ID ed0967abe2632b17680fd18e07bdb8763048a288
    # Parent  e0548937cfe3e0fbf3b6cfd299dc866d59d7a028
    Don't convert multi-dimensional Java arrays to Lisp vectors.
    
    See <http://abcl.org/trac/ticket/347>.
    
    diff -r e0548937cfe3 -r ed0967abe263 src/org/armedbear/lisp/JavaObject.java
    a b  
    249249        if (obj instanceof Character)
    250250            return LispCharacter.getInstance((Character)obj);
    251251
    252         if (obj instanceof Object[]) {
     252        // Convert only one dimensional Java arrays to Lisp vectors
     253        if (obj instanceof Object[]
     254            && ! intendedClass.getName().startsWith("[", 1))
     255        {
    253256            Object[] array = (Object[]) obj;
    254257            SimpleVector v = new SimpleVector(array.length);
    255258            for (int i = array.length; i-- > 0;)