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

Bug 331572

Summary: MOXy: Attributes not handled correctly for choice mappings containing object references during unmarshal
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Supporting tests + updated build.xml none

Description David McCann CLA 2010-12-01 12:25:50 EST
For unmarshal in the single case, where an attribute is used to set up an underlying reference mapping, we should be calling attribute() on the XMLChoiceObjectMappingNodeValue - which will simply call attribute() on the underlying choice element node value.  For example:


/**
 * The underlying choice element node value will handle attributes.
 * 
 */
public void attribute(UnmarshalRecord unmarshalRecord, String URI, 
    String localName, String value) {

  this.choiceElementNodeValue.attribute(unmarshalRecord, URI, 
      localName, value);
}
Comment 1 David McCann CLA 2010-12-01 13:02:54 EST
We will most-likely require this  fix in the collection case as well.
Comment 2 David McCann CLA 2010-12-02 12:06:18 EST
Created attachment 184371 [details]
Proposed fix
Comment 3 David McCann CLA 2010-12-02 12:06:55 EST
Created attachment 184372 [details]
Supporting tests + updated build.xml

build.xml was updated to exclude the choice tests for deployment xml.
Comment 4 David McCann CLA 2010-12-02 13:05:03 EST
Reviewed by:  matt.macivor@oracle.com
Tests: all SDO/MOXy unit tests pass as expected; oxm/mappings/choice/ref/XMLChoiceWithReferenceTestCases

Revision: 8601
Comment 5 David McCann CLA 2010-12-02 13:05:33 EST
Fixed.
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:33:08 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink