[ 
https://issues.apache.org/jira/browse/JDO-550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541617
 ] 

Andy Jefferson commented on JDO-550:
------------------------------------

with description this time ...

There is an undocumented system property (besides the jvm source) in JDK
5 and 6 called "sun.lang.ClassLoader.allowArraySyntax". The default
changed from true to false in JDK6. So what this means is that in JDK6,
unless you set that property to true, if you try and load a Java array
type using a classloader (e.g. "[[B") you will get a CNFE.

The compatible solution is to either interpret array types directly (not
hard), or to use the extended form of Class.forName(), which does
understand the array syntax:

Class clazz = Class.forName(className, false, loader);


So its a regression with the JDK (though they want to call it a change in 
default).

> TestArrayCollections fails
> --------------------------
>
>                 Key: JDO-550
>                 URL: https://issues.apache.org/jira/browse/JDO-550
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 1
>            Reporter: Michelle Caisse
>            Assignee: Andy Jefferson
>
> 1) 
> test(org.apache.jdo.tck.models.fieldtypes.TestArrayCollections)junit.framework.AssertionFailedError:
>  Assertion (TestArrayCollections) failed: 
> Expected and observed do not match!!
> For element embedded-element=false public String [] ArrayOfString6, retrieved 
> field is null.
> For element embedded-element=true public String [] ArrayOfString7, retrieved 
> field is null.
> For element embedded-element=false public Date [] ArrayOfDate8, retrieved 
> field is null.
> For element embedded-element=true public Date [] ArrayOfDate9, retrieved 
> field is null.
> For element embedded-element=false public Locale [] ArrayOfLocale10, 
> retrieved field is null.
> For element embedded-element=true public Locale [] ArrayOfLocale11, retrieved 
> field is null.
> For element embedded-element=false public BigDecimal [] ArrayOfBigDecimal12, 
> retrieved field is null.
> For element embedded-element=true public BigDecimal [] ArrayOfBigDecimal13, 
> retrieved field is null.
> For element embedded-element=false public BigInteger [] ArrayOfBigInteger14, 
> retrieved field is null.
> For element embedded-element=true public BigInteger [] ArrayOfBigInteger15, 
> retrieved field is null.
> For element embedded-element=false public Byte [] ArrayOfByte16, retrieved 
> field is null.
> For element embedded-element=true public Byte [] ArrayOfByte17, retrieved 
> field is null.
> For element embedded-element=false public Double [] ArrayOfDouble18, 
> retrieved field is null.
> For element embedded-element=true public Double [] ArrayOfDouble19, retrieved 
> field is null.
> For element embedded-element=false public Float [] ArrayOfFloat20, retrieved 
> field is null.
> For element embedded-element=true public Float [] ArrayOfFloat21, retrieved 
> field is null.
> For element embedded-element=false public Integer [] ArrayOfInteger22, 
> retrieved field is null.
> For element embedded-element=true public Integer [] ArrayOfInteger23, 
> retrieved field is null.
> For element embedded-element=false public Long [] ArrayOfLong24, retrieved 
> field is null.
> For element embedded-element=true public Long [] ArrayOfLong25, retrieved 
> field is null.
> For element embedded-element=false public Short [] ArrayOfShort26, retrieved 
> field is null.
> For element embedded-element=true public Short [] ArrayOfShort27, retrieved 
> field is null.
> For element embedded-element=false public SimpleEnum [] ArrayOfSimpleEnum28, 
> retrieved field is null.
> For element embedded-element=true public SimpleEnum [] ArrayOfSimpleEnum29, 
> retrieved field is null.
> For element embedded-element=true public SimpleEnum [] ArrayOfSimpleEnum30, 
> retrieved field is null.
>       at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:639)
>       at 
> org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.checkValues(TestArrayCollections.java:200)
>       at 
> org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.runTest(TestArrayCollections.java:112)
>       at 
> org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.test(TestArrayCollections.java:74)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
>       at 
> org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
>       at 
> org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
>       at 
> org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to