Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326548 - MOXy Extensions: Should support arrays via container-type
Summary: MOXy Extensions: Should support arrays via container-type
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-29 11:15 EDT by David McCann CLA
Modified: 2022-06-09 10:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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