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

Bug 367890

Summary: [Validation] Improper validation for XmlElement with type specified alongside XmlJavaTypeAdapter
Product: [WebTools] Dali JPA Tools Reporter: Paul Fullbright <paul.fullbright>
Component: JAXBAssignee: Paul Fullbright <paul.fullbright>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt, neil.hauge, shaun.smith
Version: 3.1   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Test project with schema and xml bindings file and pre-generated source code. none

Description Paul Fullbright CLA 2012-01-04 15:29:07 EST
Created attachment 209035 [details]
Test project with schema and xml bindings file and pre-generated source code.

The attached project will explain somewhat, but the situation is this.

    @XmlElement(type = String.class)
    @XmlJavaTypeAdapter(Adapter1 .class)
    @XmlSchemaType(name = "dateTime")
    protected Calendar date;

This is causing an invalid validation error: "XML element type must be a sub-type of 'java.util.Calendar'."

The type String should refer to the type as it leaves the adapter but before it is marshalled, not the actual type of the field.

(There is another error, but should probably be fixed in the natural course of addressing the other error.)
Comment 1 Paul Fullbright CLA 2012-01-18 18:53:59 EST
fixed in 3.2 M5
Comment 2 Neil Hauge CLA 2012-01-19 09:29:57 EST
Shaun, is fixing this in head for M5 sufficient, or do you need a patch on 3.1?
Comment 3 Jolene Moffitt CLA 2012-01-26 14:36:25 EST
Verified in Build I-3.4.0-20120119095402 

Verified when you import the attached project and update the properties the validation errors do not appear.  See the link to view test steps for verification.  http://wiki.eclipse.org/Dali_3.2_M5