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

Bug 345202

Summary: Redundant package generated with JAXB class gen
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: JAXBAssignee: Tran Le <tranle1>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: unspecified   
Target Milestone: 3.0.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
XML Schema none

Description Nan Li CLA 2011-05-09 16:36:53 EDT
Build Identifier: I20110428-0848

Try to generate classes from the attached XML by selecting "New -> JAXB -> JAXB Classes from Schema" and giving a package name like fooGen when asked, you will see a redundant empty package fooGen.Foo1 will be generated under the JAXB Content. This happens when defining an element in Foo1 like

<xsd:element name="foo2s" minOccurs="0">
   <xsd:complexType>
       <xsd:sequence>
          <xsd:element name="foo2" type="foo2" minOccurs="0" maxOccurs="unbounded"/>
       </xsd:sequence>
   </xsd:complexType>
</xsd:element>

PS: In Java class, the corresponding element would be defined like

    @XmlElementWrapper(name="foo2s")
    private List<Foo2> foo2;

Reproducible: Always
Comment 1 Nan Li CLA 2011-05-09 16:39:33 EDT
Created attachment 195144 [details]
XML Schema
Comment 2 Neil Hauge CLA 2011-05-11 17:00:12 EDT
This is most likely a problem with the JAXB XJC and not Dali code. Tran, please confirm.
Comment 3 Tran Le CLA 2011-06-01 11:56:37 EDT
Nan I cannot reproduce this issue, please reopen if it is still a problem for you.
Comment 4 Nan Li CLA 2011-06-01 16:16:24 EDT
I can reproduce it with the build of I20110428-0848 with which the bug was found and the build of I20110512-2000, but cannot with the build of I20110525-0800.