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

Bug 340364

Summary: SCHEMA GENERATION OMITS PROPERTY WITH XMLJAVATYPEADAPTER ANNOTATION
Product: z_Archived Reporter: Matt MacIvor <matt.macivor>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Fix none

Description Matt MacIvor CLA 2011-03-17 15:09:52 EDT
Given a class such as:
public static class NormalizedString{
    @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
    private String normalized;
}

Eclispelink JAXB generates a schema definition missing the attribute.

Eclipselink JAXB:
<xsd:complexType name="normalizedString"/>

Correct Schema:
<xs:complexType name="normalizedString">
    <xs:sequence>
      <xs:element name="normalized" type="xs:string" minOccurs="0"/>
    </xs:sequence>
</xs:complexType>

Note there are correctly no public getters/setters and the member is private,
but this is still handled by Sun JAXB due to the presence of the annotation.

If we add the public accessors, this works for Eclipselink, but only
apparently because it is ignoring the annotation.  For Sun JAXB adding the  
public accessors leads to:
Exception in thread "main"
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
IllegalAnnotationExceptions
Class has two properties of the same name "normalized".

So the public accessors should not be present.
Comment 1 Matt MacIvor CLA 2011-03-17 15:24:41 EDT
Created attachment 191459 [details]
Proposed Fix
Comment 2 Matt MacIvor CLA 2011-03-21 10:27:17 EDT
Attached Patch checked in to SVN
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:36:24 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink