So the testCharArray failure comes down to this conflict mentioned in the
org.jboss.metadata.spi.signature.Signature.stringsToClasses comment
| //For arrays we will want to load the class, the ArrayInfoImpl generates
names in an invalid format, resolve this here
| String primitiveCandidate = param.substring(index + 1);
| String componentType = primitiveArrayTypes.get(primitiveCandidate);
|
|
The same encoded names as found in primitiveArrayTypes should be going into the
ArrayInfoImpl name when a primative type is the element type:
| public ArrayInfoImpl(TypeInfo componentType)
| {
| this.componentType = componentType;
| StringBuilder builder = new StringBuilder();
| builder.append("[");
| TypeInfo temp = componentType;
| while (temp.isArray())
| {
| builder.append("[");
| temp = ((ArrayInfo) temp).getComponentType();
| }
| if (temp.getClass().equals(PrimitiveInfo.class))
| {
| //builder.append(temp.getName());
| // Use the signature encoded name for the primitive element type
| String encodedName = Signature.getPrimativeArrayType(temp.getName());
| builder.append(encodedName);
| }
| else
| {
| builder.append("L").append(temp.getName()).append(";");
| }
| name = builder.toString();
| calculateHash();
| }
|
with that change, the IntrospectionArrayUnitTestCase.testCharArray passes, but the
JavassistArrayUnitTestCase.testCharArray fails with the following. The
JavassistArrayInfoImpl also needs to be updated. If I do that all container unit tests are
passing.
| junit.framework.AssertionFailedError:
expected:<JavassistArrayInfoImpl@75843a75{name=[Lchar;}> but
was:<ArrayInfoImpl@3c1a1399{name=[C}>
| at junit.framework.Assert.fail(Assert.java:47)
| at junit.framework.Assert.failNotEquals(Assert.java:282)
| at junit.framework.Assert.assertEquals(Assert.java:64)
| at junit.framework.Assert.assertEquals(Assert.java:71)
| at
org.jboss.test.classinfo.test.AbstractClassInfoTest.testBasics(AbstractClassInfoTest.java:74)
| at
org.jboss.test.classinfo.test.ClassInfoArrayTest.testArray(ClassInfoArrayTest.java:96)
| at
org.jboss.test.classinfo.test.ClassInfoArrayTest.testCharArray(ClassInfoArrayTest.java:52)
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071748#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...