Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326548

Summary: MOXy Extensions: Should support arrays via container-type
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David McCann CLA 2010-09-29 11:15:21 EDT
We should support setting an array type via the container-type attribute.  For example,

public class Employee {
    public Object[] peers;
}

<xml-element java-attribute="peers" type="Employee" container-type="Employee[]" />

There is a bug open against JDK6 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149) that affects this support.  We need to create a JavaClass from the string (in the above case, "Employee[]") which requires a classloader.loadClass call.  loadClass on arrays fails in JDK6 but not in JDK5.  

We will need to work around this with something like:

Array.newInstance("Employee.class").getClass();
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:27:21 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink