Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335339 - Anonymous types should not appear in XMLContext.descriptorsByGlobalType map
Summary: Anonymous types should not appear in XMLContext.descriptorsByGlobalType map
Status: NEW
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: 2011-01-25 11:34 EST by Rick Barkhouse CLA
Modified: 2022-06-09 10:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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