Castor generates code which doesn't compile
-------------------------------------------
Key: MCASTOR-37
URL: https://jira.codehaus.org/browse/MCASTOR-37
Project: Maven 2.x Castor Plugin
Issue Type: Bug
Affects Versions: 2.1
Reporter: Michiel Kalkman
I am using the following xsd to generate java code:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://domain" xmlns:tns="http://domain"
attributeFormDefault="unqualified" elementFormDefault="qualified">
...
<xs:simpleType name="BFlowType">
<xs:restriction base="xs:string">
<xs:enumeration value="component2resource"/> <!--
Component sends data -->
<xs:enumeration value="resource2component"/> <!--
Component receives data -->
<xs:enumeration value="inout"/> <!-- Component
receives and sends data -->
</xs:restriction>
</xs:simpleType>
...
Using org.codehaus.mojo:castor-maven-plugin:2.0 I get compilable java code.
With org.codehaus.mojo:castor-maven-plugin:2.1 I get code that does not compile:
/*
* This class was automatically generated with
* <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
* Schema.
* $Id$
*/
...
/**
* Field enumConstants.
*/
private static final java.util.Map<java.lang.String, BFlowType>
enumConstants = new java.util.HashMap<java.lang.String, BFlowType>();
static {
for (BFlowType c: BFlowType.values()) {
BFlowType.enumConstants.put(c.value, c);
}
};
The final semi-colon gives the compilation error.
Perhaps the problem is already resolved in castor-codegen 1.3.2?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email