[
https://issues.apache.org/jira/browse/AXIS2-3206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528250
]
Amila Chinthaka Suriarachchi commented on AXIS2-3206:
-----------------------------------------------------
this occurs if you have given a pattern facet for a simple type restricting
boolean.
i.e
<simpleType name="test">
<restriction base="xs:boolean>
<pattern value=""/>
</restriction>
</simpleType>
So what you basicaly saying is defining a pattern facet in a schema for boolean
is incorrect. I am not sure about this but I think once it is given adding that
restriction is correct.
eg. if some one expects only true values he can restric it by using this
pattern.
> 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]