You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jan Arend Jansen (JIRA)" <ji...@apache.org> on 2010/03/11 17:59:27 UTC
[jira] Updated: (CXF-2707) CXF-XJC-DV doesn not respect Abstract
schema types
[ https://issues.apache.org/jira/browse/CXF-2707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jan Arend Jansen updated CXF-2707:
----------------------------------
Attachment: DefaultValuePlugin.java
> CXF-XJC-DV doesn not respect Abstract schema types
> --------------------------------------------------
>
> Key: CXF-2707
> URL: https://issues.apache.org/jira/browse/CXF-2707
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.2.1
> Reporter: Jan Arend Jansen
> Priority: Minor
> Attachments: DefaultValuePlugin.java
>
>
> The cxf-xjc-dv plugin creates default values for complex types that have default simpl typed elements as fixed in CXF-1206.
> {code:xml}
> <xs:complexType name="pageColor">
> <xs:sequence>
> <xs:element name="background" type="xs:string" default="red"/>
> <xs:element name="foreground" type="xs:string" default="blue"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
> {code}
> results in
> {code}
> protected PageColor pageColor = new PageColor();
> {code}
> This fails if PageColor is defined as abstract="true" in the schema (used as polymorphic type in element pageColor). In that case the line above will create a compilation error.
> It can be fixed by simply skipping the generation of the default 'new PageColor();' in those cases.
> Line 81 in DefaultValuePlugin.java would become
> {code}
> if (classOutline.implClass == field.getRawType() && !classOutline.implClass.isAbstract()) {
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.