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

Bug 363862

Summary: validation error for package-info.java XmlJavaTypeAdapter sometimes missing
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JAXBAssignee: Neil Hauge <neil.hauge>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: neil.hauge, paul.fullbright
Version: 3.1   
Target Milestone: 3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karen Butzke CLA 2011-11-15 14:22:46 EST
If you specify an XmlJavaTypeAdapter on a package-info.java as the DEFAULT, but do not fully qualify it, you don't get a validation error. If you instead specify type=javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT.class you get the JAXB validation error: "The type must be specified for an XML Java type adapter on a package"

No validation error in this case:
@XmlJavaTypeAdapter(value=com.sun.xml.bind.AnyTypeAdapter.class, type=XmlJavaTypeAdapter.DEFAULT.class)
package model;

import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
Comment 1 Karen Butzke CLA 2011-11-15 14:31:36 EST
No validation error is given for this case either:
@XmlAttribute
@XmlJavaTypeAdapter(value=MyAdapter.class)
public List foo;
Comment 2 Paul Fullbright CLA 2012-03-21 15:39:34 EDT
The second use case is as designed.  Metro will fail in this case, but MOXy will not.  It's more a case of us not having enough information to give a good error.
Comment 3 Paul Fullbright CLA 2012-03-22 12:25:55 EDT
Committed for 3.2 M7.