[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rampart-dev
Subject:    [jira] [Created] (AXIS2-5848) After use -Eiu in wsdl2java.sh, factory classes for enumeration typte 
From:       "Jing Teng (JIRA)" <jira () apache ! org>
Date:       2017-04-27 0:00:55
Message-ID: JIRA.13067204.1493251239000.61039.1493251255907 () Atlassian ! JIRA
[Download RAW message or body]

Jing Teng created AXIS2-5848:
--------------------------------

             Summary: After use -Eiu in wsdl2java.sh, factory classes for enumeration \
typte log warning erroneously  Key: AXIS2-5848
                 URL: https://issues.apache.org/jira/browse/AXIS2-5848
             Project: Axis2
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.7.4
            Reporter: Jing Teng


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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic