Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371102 - ListWrapper should not throw exception when unmarshalling null values (on a non-nullable property)
Summary: ListWrapper should not throw exception when unmarshalling null values (on a n...
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:
Depends on:
Blocks:
 
Reported: 2012-02-09 11:17 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:07 EDT (History)
1 user (show)

See Also:


Attachments
SDO - Test Cases (4.75 KB, patch)
2012-02-09 11:18 EST, Blaise Doughan CLA
no flags Details | Diff
SDO - Fix (586 bytes, patch)
2012-02-09 11:19 EST, Blaise Doughan CLA
no flags Details | Diff
SDO - Test Cases (5.21 KB, patch)
2012-02-09 11:57 EST, Blaise Doughan CLA
no flags Details | Diff
SDO - Fix (Part 2) (1.77 KB, patch)
2012-02-09 15:25 EST, Blaise Doughan CLA
no flags Details | Diff
SDO - Test Cases (Part 2) (6.55 KB, patch)
2012-02-09 15:26 EST, 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 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