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

Bug 368482

Summary: MOXy IDResolver is not "drop-in" replacement for RI IDResolver
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Rick Barkhouse <rick.barkhouse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 359251    
Attachments:
Description Flags
Patch - code changes (trunk)
none
Patch - test changes (trunk)
none
Patch - code changes (trunk) none

Description Rick Barkhouse CLA 2012-01-12 14:53:40 EST
When using the Sun JAXB implementation, users specified a custom IDResolver as follows:

unmarshaller.setProperty("com.sun.xml.bind.IDResolver", new MyIDResolver());
or
unmarshaller.setProperty(IDResolver.class.getName(), new MyIDResolver());

where IDResolver is com.sun.xml.bind.IDResolver, and MyIDResolver is an implementation of that interface.

For MOXy, an equivalent interface was created, org.eclipse.persistence.jaxb.IDResolver, and the user's custom resolver class must implement that MOXy interface.

If we want the user to be able migrate to MOXy from the Sun JAXB without having to change any code at all, we will have to include the com.sun.xml.bind interface in MOXy as well, so that we can use it in our own code.  We will then have to ask the user to implement a Sun interface to get the benefits of this feature.

We have the same issue with the upcoming NamespacePrefixResolver -- how are we going to handle these?


MOXy IDResolver - Bug 360249
Comment 1 Rick Barkhouse CLA 2012-01-26 11:27:15 EST
Our requirement is that EclipseLink be a drop in replacement for the Sun implementation, with no additional work for the user to continue using their current IDResolver code, so we must also support com.sun.xml.bind.IDResolvers reflectively.
Comment 2 Rick Barkhouse CLA 2012-02-28 12:20:10 EST
Created attachment 211751 [details]
Patch - code changes (trunk)
Comment 3 Rick Barkhouse CLA 2012-02-28 12:20:38 EST
Created attachment 211752 [details]
Patch - test changes (trunk)
Comment 4 Rick Barkhouse CLA 2012-02-28 13:49:34 EST
Created attachment 211757 [details]
Patch - code changes (trunk)
Comment 5 Rick Barkhouse CLA 2012-02-28 15:29:02 EST
Fixed in both trunk and 2.3, reviewed by mmacivor.
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:03:30 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink