Wrong java code generation with adb for data type boolean
---------------------------------------------------------

                 Key: AXIS2-3206
                 URL: https://issues.apache.org/jira/browse/AXIS2-3206
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.2, 1.3
         Environment: Windows XP, Java 1.4.2
            Reporter: Heinz Zerbes


Java code generation with adb generates wrong code in case of data type 
boolean. This problem occures for example in 
setMustUnderstand_type0(boolean param); The generated code is generic (the same 
for all data types). Unfortunatelly boolean does not fit into this generation 
pattern(instead of checking "true|false" "0|1" ist checked). Also for boolean 
it makes no sense to check the data type, because the java compiler does it 
anyway. 

The problem is located in ADBBeanTemplate.xsl: 
                                        <xsl:choose>
                                                <xsl:when 
test="(@patternFacet)">
                                                  if 
(java.lang.String.valueOf(param).matches("<xsl:value-of 
select="$patternFacet"/>")) {
                                                       this.<xsl:value-of 
select="$varName"/>=param; }
                                                 else {
                                                     throw new 
java.lang.RuntimeException(); }
                                                ......

For type==boolean it should be:
                                        <xsl:choose>
                                                <xsl:when 
test="(@patternFacet)">
                                                <xsl:choose>
                                                  <xsl:when 
test="$propertyType='boolean'">
                                                  this.<xsl:value-of 
select="$varName"/>=param;
                                                                                
</xsl:when
                                                <xsl:otherwise>
                                                  if 
(java.lang.String.valueOf(param).matches("<xsl:value-of 
select="$patternFacet"/>")) {
                                                       this.<xsl:value-of 
select="$varName"/>=param; }
                                                 else {
                                                     throw new 
java.lang.RuntimeException(); }
                                                </xsl:otherwise>
                                        </xsl:choose>





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to