Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369538 - Empty @XmlList should be marshalled to XML
Summary: Empty @XmlList should be marshalled to XML
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: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 10:53 EST by Rick Barkhouse CLA
Modified: 2022-06-09 10:20 EDT (History)
1 user (show)

See Also:


Attachments
Patch - 2.3 (3.98 KB, patch)
2012-03-12 15:17 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - trunk (4.01 KB, patch)
2012-03-12 15:17 EDT, Rick Barkhouse 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 2012-01-24 10:53:33 EST
The way in which MOXy marshalls empty collections annotated with @XmlList differs from the way the Sun implementation works:

@XmlRootElement
public class TestClass {

    @XmlList
    protected List<String> collection2;
    
}

class org.eclipse.persistence.jaxb.JAXBContext
Null Collection:
<?xml version="1.0" encoding="UTF-8"?>
<testClass/>
Empty Collection:
<?xml version="1.0" encoding="UTF-8"?>
<testClass/>

class com.sun.xml.bind.v2.runtime.JAXBContextImpl
Null Collection:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testClass/>
Empty Collection:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testClass>
    <collection2></collection2>
</testClass>
Comment 1 Rick Barkhouse CLA 2012-03-12 15:17:02 EDT
Created attachment 212492 [details]
Patch - 2.3
Comment 2 Rick Barkhouse CLA 2012-03-12 15:17:21 EDT
Created attachment 212494 [details]
Patch - trunk
Comment 3 Rick Barkhouse CLA 2012-03-13 12:10:48 EDT
Fixed in 2.3 and trunk, reviewed by bdoughan
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:20:44 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink