Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
1.7.4
-
None
-
None
Description
For this schema,
<xs:simpleType name="CabinType"> <xs:restriction base="xs:string"> <xs:enumeration value="Default"/> <xs:enumeration value="Y"/> <xs:enumeration value="S"/> <xs:enumeration value="C"/> <xs:enumeration value="J"/> <xs:enumeration value="F"/> <xs:enumeration value="P"/> </xs:restriction> </xs:simpleType>
Without -Eiu, the generated code is
public static class Factory { public static CabinType fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { CabinType enumeration = (CabinType) _table_.get(value); // handle unexpected enumeration values properly if (enumeration == null) { throw new java.lang.IllegalArgumentException(); } return enumeration; }
With -Eiu, the code is
public static class Factory { public static CabinType fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { CabinType enumeration = (CabinType) _table_.get(value); // handle unexpected enumeration values properly log.warn("Unexpected value " + value + " for enumeration CabinType"); return enumeration; }
Obviously the code above is wrong
Attachments
Issue Links
- duplicates
-
AXIS2-5771 -Eiu option logs Unexpected value for enumeration every time
- Resolved