Bug 279003 - JAXB 2.1 TCK - Maintain pre-initialized collection type
Summary: JAXB 2.1 TCK - Maintain pre-initialized collection type
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Blaise Doughan CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2009-06-03 15:06 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:07 EDT (History)
1 user (show)

See Also:


Attachments
Previous patch attempt (49.55 KB, patch)
2009-07-22 17:02 EDT, Rick Barkhouse CLA
no flags Details | Diff
Core - Fix (67.52 KB, patch)
2009-08-11 10:15 EDT, Blaise Doughan CLA
no flags Details | Diff
MOXy - Fix (38.11 KB, patch)
2009-08-11 10:16 EDT, Blaise Doughan CLA
no flags Details | Diff
MOXy Test Cases (53.29 KB, patch)
2009-08-11 10:16 EDT, Blaise Doughan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Barkhouse CLA 2009-06-03 15:06:10 EDT
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
Comment 1 Rick Barkhouse CLA 2009-07-22 17:02:18 EDT
Created attachment 142323 [details]
Previous patch attempt
Comment 2 Blaise Doughan CLA 2009-08-11 10:15:49 EDT
Created attachment 144045 [details]
Core - Fix
Comment 3 Blaise Doughan CLA 2009-08-11 10:16:22 EDT
Created attachment 144046 [details]
MOXy - Fix
Comment 4 Blaise Doughan CLA 2009-08-11 10:16:57 EDT
Created attachment 144047 [details]
MOXy Test Cases
Comment 5 Blaise Doughan CLA 2009-08-11 11:14:01 EDT
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
Comment 6 Peter Krogh CLA 2009-08-26 09:54:42 EDT
Mass update to change fixed in target.
Comment 7 Peter Krogh CLA 2009-08-26 09:57:25 EDT
Mass update to change fixed in target.
Comment 8 Peter Krogh CLA 2009-08-26 10:03:03 EDT
Mass update to change fixed in target.
Comment 9 Peter Krogh CLA 2009-08-26 10:05:11 EDT
Mass update to change fixed in target.
Comment 10 Eclipse Webmaster CLA 2022-06-09 10:07:50 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink