Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338446 - Generated Schema has incorrect type for referenced element
Summary: Generated Schema has incorrect type for referenced element
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-28 13:37 EST by Matt MacIvor CLA
Modified: 2022-06-09 10:30 EDT (History)
0 users

See Also:


Attachments
Propsed Fix (1.48 KB, patch)
2011-02-28 15:22 EST, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt MacIvor CLA 2011-02-28 13:37:01 EST
When generating a schema from the following class:
@XmlRootElement(name = "echoBarAndBarResponse", namespace = "http://echo.org/")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "echoBarAndBarResponse", namespace = "http://echo.org/")
public class EchoTwoBarResponse {

    @XmlElement(name = "return", namespace = "urn:barresultns", nillable = true)
    private Bar[] _return;

    public Bar[] getReturn() {
       return this._return;
    }

    public void setReturn(Bar[] _return) {
      this._return = _return;
    }
}

public class Bar {
    private int age;

    public Bar() {
    }

    public Bar(int age) {
       this.age = age;
    }

    public int getAge() {
      return age;
    }

    public void setAge(int age) {
       this.age = age;
    }
} 

The type for the schema element "return" incorrectly references the schema type for Bar in the "urn:barresultns". In this case the schema type for Bar is in the "http://echo.org/" namespace, since "http://echo.org/" was specified as the defaultTargetNamespace and no @XmlType or @XmlSchema annotation has specified anything different.
Comment 1 Matt MacIvor CLA 2011-02-28 15:22:01 EST
Created attachment 189989 [details]
Propsed Fix
Comment 2 Matt MacIvor CLA 2011-03-01 09:59:13 EST
Attached patch checked in to SVN
Reviewed by Blaise Doughan
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:30:19 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink