axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AXIS2-5070) Enumeration type fromValue() function update breaks stub compilation
Date Sun, 24 Jan 2016 15:34:41 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andreas Veithen updated AXIS2-5070:
-----------------------------------
    Fix Version/s:     (was: 1.7.0)
                   1.7.1

> Enumeration type fromValue() function update breaks stub compilation
> --------------------------------------------------------------------
>
>                 Key: AXIS2-5070
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5070
>             Project: Axis2
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.6.0
>            Reporter: Vilnis Termanis
>            Assignee: Sagara Gunathunga 
>             Fix For: 1.7.1
>
>
> The "fix" in AXIS2-3034 unfortunately breaks WSDL generation in that the fromValue()
function is not compilable in certain situations. For example, with the following type: 
>  <xs:simpleType name="tSomeType"> 
>      <xs:restriction base="xs:int"> 
>        <xs:enumeration value="1"> 
>          <xs:annotation> 
>            <xs:documentation>Something</xs:documentation> 
>          </xs:annotation> 
>        </xs:enumeration> 
>        <xs:enumeration value="2"> 
>          <xs:annotation> 
>            <xs:documentation>Something else</xs:documentation> 
>          </xs:annotation> 
>        </xs:enumeration> 
>      </xs:restriction> 
>    </xs:simpleType> 
> Corresponding fromValue function now contains: 
>  public static TSomeType fromValue(int value) 
>                        throws java.lang.IllegalArgumentException { 
>                      TSomeType enumeration = (TSomeType) 
>                          
>                               _table_.get(value + ""); 
>                              
>                      if ((enumeration == null) && !((value == null) || (value.equals(""))))
{ 
>                          throw new java.lang.IllegalArgumentException(); 
>                      } 
>                      return enumeration; 
>                  } 
>  Since value is of type 'int', the updated if statement results in compilation failure
("int cannot be dereferenced"). 
>  Tested with Axis2 1.6.0 wsdl2java. 
>  Regards, 
>  VT



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message