Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363520 - incorrect validation on propOrder element if field is transient and property is annotated
Summary: incorrect validation on propOrder element if field is transient and property ...
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard: fix_ready
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 14:24 EST by Karen Butzke CLA
Modified: 2011-11-28 14:43 EST (History)
2 users (show)

See Also:
neil.hauge: review+


Attachments
proposed patch (1.64 KB, patch)
2011-11-15 11:03 EST, Paul Fullbright CLA
no flags Details | Diff

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