[
https://issues.apache.org/jira/browse/AXIS2-3206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Heinz Zerbes updated AXIS2-3206:
--------------------------------
Thank you for your quick reply!!
The generated code for boolean is the following:
/**
* Auto generated setter method
* @param param MustUnderstand_type0
*/
public void setMustUnderstand_type0(boolean param){
if (java.lang.String.valueOf(param).matches("0|1")) {
this.localMustUnderstand_type0=param;
}
else {
throw new java.lang.RuntimeException();
}
}
The problem is, that java.lang.String.valueOf(param) produces in this case
"true|false" and never "0|1", so the RuntimeException is always thrown.
> 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.3, 1.2
> 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]