Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
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())
};
The final semi-colon gives the compilation error.
Perhaps the problem is already resolved in castor-codegen 1.3.2?
Can I please ask you to raise this as a problem over at the CASTOR project, as it seems to be a genuine problem of code generation related to one specific version of Castor ?