Community
Participate
Working Groups
In the following JAXB scenario: @XmlRootElement(name = "root") public class Root { @XmlElementRefs({ @XmlElementRef(name = "time", type = JAXBElement.class), @XmlElementRef(name = "date", type = JAXBElement.class) }) protected List<JAXBElement<XMLGregorianCalendar>> dateOrTime = new LinkedList<JAXBElement<XMLGregorianCalendar>>(); The "dateOrTime" variable is typed as [List], but pre-initialized to a [LinkedList]. Currently in Eclipselink we will only recognize that the variable is of type list and when building the object we will instantiate the default collection class, which is [Vector]. A check should be added to see if the List variable is already initialized during class instantiation, and then use that collection instead of creating a new one. TCK Test: schema_bind/bind_globalBindings/collectionType/collectionType00101m2.html#collectionType00101m2_p
Created attachment 142323 [details] Previous patch attempt
Created attachment 144045 [details] Core - Fix
Created attachment 144046 [details] MOXy - Fix
Created attachment 144047 [details] MOXy Test Cases
Fixed in trunk at revision: 4832 - Added support for converters on choice mappings - Added re-use collection mechanism on all collection mappings (SAX only) - Fixed converter initialization on any object mapping-metadata.xml - JAXB - removed JAXBElementAttributeAccessor, replaced functionality with converters - JAXB - added default element converter
Mass update to change fixed in target.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink