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

Bug 335339

Summary: Anonymous types should not appear in XMLContext.descriptorsByGlobalType map
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rick Barkhouse CLA 2011-01-25 11:34:23 EST
Considering the following schema:

-----
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:myns="mynamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
    jxb:version="1.0" targetNamespace="mynamespace" attributeFormDefault="qualified" elementFormDefault="qualified">

    <xs:element name="person">
        <xs:complexType>
            <xs:annotation>
                <xs:appinfo>
                    <jxb:class name="PersonE"/>
                </xs:appinfo>
            </xs:annotation>
            <xs:sequence>
                <xs:element name="first-name" type="xs:string"/>
                <xs:element name="last-name" type="xs:string"/>                
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="root" type="myns:person"/>

    <xs:complexType name="person">
        <xs:sequence>
            <xs:element name="full_name" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

</xs:schema>
-----

After processing this schema with DynamicJAXB, the XMLContext.descriptorsByGlobalType map will contain two entries:

    XMLFragment("mynamespace", "") -> Descriptor(PersonE)
    XMLFragment("mynamespace", "person") -> Descriptor(Person)

The anonymous type should not appear in the map, as there could potentially be multiple anonymous types that would all share the same XMLFragment key.
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:24:29 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink