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

Bug 363520

Summary: incorrect validation on propOrder element if field is transient and property is annotated
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JAXBAssignee: Paul Fullbright <paul.fullbright>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt, neil.hauge
Version: 3.1Flags: neil.hauge: review+
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: fix_ready
Attachments:
Description Flags
proposed patch none

Description Karen Butzke CLA 2011-11-10 14:24:29 EST
With the following class I get a validation error on the propOrder element of XmlType. the 'shipTo' field is transient because the shipTo property is instead annotated.

"The property 'shipTo' is transient and should not be included in the property order."


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PurchaseOrderType", propOrder = {
    "shipTo",
    "billTo"
})
public class PurchaseOrder {

    @XmlTransient
    protected USAddress shipTo;

    @XmlElement(required = true)
    protected USAddress billTo;


    @XmlElement(name="shipTo", required = true)
    public USAddress getShipTo() {
        return shipTo;
    }
    public void setShipTo(USAddress value) {
        this.shipTo = value;
    }
}
Comment 1 Paul Fullbright CLA 2011-11-15 11:03:34 EST
Created attachment 207036 [details]
proposed patch

changed validation algorithm to detect if an attribute name has a non-transient mapping rather than just checking if it has a transient mapping.
Comment 2 Paul Fullbright CLA 2011-11-15 11:11:59 EST
fixed for 3.1 rc2
Comment 3 Jolene Moffitt CLA 2011-11-28 14:43:17 EST
Verified in Build S-3.1.0-20111117042513 

Verified when you create the class above, that no error appears stating - "The property 'shipTo' is transient and should not be included in the property
order."  See the link to view test steps for verification.
http://wiki.eclipse.org/Dali_3.1_RC2