Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363862 - validation error for package-info.java XmlJavaTypeAdapter sometimes missing
Summary: validation error for package-info.java XmlJavaTypeAdapter sometimes missing
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.2   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-15 14:22 EST by Karen Butzke CLA
Modified: 2012-03-22 12:25 EDT (History)
2 users (show)

See Also:


Attachments

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