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

Bug 327608

Summary: Externalized Metadata - Unnecessary Classes Processed
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matt.macivor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
sample projects that demonstrate the problem
none
Proposed Fix none

Description Blaise Doughan CLA 2010-10-12 15:57:02 EDT
When externalized metadata is used it is possible that extra classes are unecessarily processed.

For example:

When processing annotated classes:

    public class Container {

        @XmlJavaTypeAdapter(adapters.UnmappableAdapter.class)
        private Unmappable containerProperty;

    }

We do not process the Unmappable class.  If however the XmlJavaTypeAdapter is specified in XML we will process the Unmappable class.  If the Unmappable class is missing a default constructor MOXy will throw an exception.
Comment 1 Tom Pasierb CLA 2010-10-13 04:35:44 EDT
Created attachment 180740 [details]
sample projects that demonstrate the problem

one project is the jaxb-ri project that "works fine" and the other one (jaxb-moxy) is using moxy and externalized metadata.

The problem occurs irrespective of the placement of the XmlJavaTypeAdapter (the unmappable class itself, the package where the unamppable type is used or the unmappable property).
Comment 2 Matt MacIvor CLA 2010-10-13 16:49:45 EDT
Created attachment 180829 [details]
Proposed Fix
Comment 3 Matt MacIvor CLA 2010-10-26 16:35:18 EDT
Attached patch checked into SVN in trunk. 

Leaving bug open pending backport into 2.1.3 stream.
Comment 4 Blaise Doughan CLA 2011-01-10 13:51:39 EST
The decision was made to not backport this fix to 2.1.3.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:18:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink