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

Bug 371102

Summary: ListWrapper should not throw exception when unmarshalling null values (on a non-nullable property)
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Blaise Doughan <blaise.doughan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.sdo-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
SDO - Test Cases
none
SDO - Fix
none
SDO - Test Cases
none
SDO - Fix (Part 2)
none
SDO - Test Cases (Part 2) none

Description Blaise Doughan CLA 2012-02-09 11:17:31 EST
The following document should be read in as having 3 items, 2 of them being empty strings.  This is consistent with the JAXB behaviour.  Currently the empty string values are being brought in as null, which is causing errors with non-nillable properties.

<root>
    <item/>
    <item>ABC</item>
    <item></item>
</root>
Comment 1 Blaise Doughan CLA 2012-02-09 11:18:47 EST
Created attachment 210808 [details]
SDO - Test Cases
Comment 2 Blaise Doughan CLA 2012-02-09 11:19:02 EST
Created attachment 210809 [details]
SDO - Fix
Comment 3 Blaise Doughan CLA 2012-02-09 11:57:09 EST
Created attachment 210812 [details]
SDO - Test Cases
Comment 4 Blaise Doughan CLA 2012-02-09 13:17:58 EST
Fix checked into trunk at rev:  10829
Fix checked into 2.3.3 at rev:  10830

Code Reviewed By:  Matt MacIvor

Fix Details:
Set the following on the XMLCompositeDirectCollectionMapping:
mapping.getNullPolicy().setNullRepresentedByEmptyNode(false);
Comment 5 Blaise Doughan CLA 2012-02-09 15:25:03 EST
This fix resulted in an undesired behaviour change.
Comment 6 Blaise Doughan CLA 2012-02-09 15:25:35 EST
Created attachment 210821 [details]
SDO - Fix (Part 2)
Comment 7 Blaise Doughan CLA 2012-02-09 15:26:05 EST
Created attachment 210822 [details]
SDO - Test Cases (Part 2)
Comment 8 Blaise Doughan CLA 2012-02-09 16:18:19 EST
Fix (Part 2) checked into trunk at rev: 10831
Fix (Part 2) checked into 2.3.3 at rev: 10832

Code reviewed by: Matt MacIvor

Fix Details:
- Reverted change from initial fix
- Moved the check for null value from ListWrapper.addAll(Collection, boolean) to ListWrapper.addAll(Collection).
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:07:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink