Community
Participate
Working Groups
Dynamic Class generation fails for an enum if it contains exactly 6 enum values. E.g.: <xs:simpleType name="compass-direction"> <xs:restriction base="xs:string"> <xs:enumeration value="NORTH" /> <xs:enumeration value="SOUTH" /> <xs:enumeration value="EAST" /> <xs:enumeration value="WEST" /> <xs:enumeration value="SWEST" /> <xs:enumeration value="NWEST" /> </xs:restriction> </xs:simpleType> Caused by: Exception [EclipseLink-50040] (Eclipse Persistence Services - 2.3.0.v20110415-r9234): org.eclipse.persistence.exceptions.JAXBException Exception Description: Error creating DynamicJAXBContext. Internal Exception: java.lang.ArrayIndexOutOfBoundsException: 6 at org.eclipse.persistence.exceptions.JAXBException.errorCreatingDynamicJAXBContext(JAXBException.java:582) ... 35 more Caused by: java.lang.ArrayIndexOutOfBoundsException: 6 at org.eclipse.persistence.dynamic.DynamicClassWriter.createEnum(DynamicClassWriter.java:303) at org.eclipse.persistence.dynamic.DynamicClassWriter.writeClass(DynamicClassWriter.java:172) at org.eclipse.persistence.dynamic.DynamicClassLoader.findClass(DynamicClassLoader.java:210) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Created attachment 193514 [details] Patch
Fixed, reviewed by bdoughan. DynamicJAXBFromXSDTestCases.testXmlEnum() has been modified to have 6 enum values to ensure this case is tested.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink