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-5273) Allow forward-compatibility by ignoring unexpected enumeration values
Date Mon, 01 May 2017 19:54:04 GMT

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

Andreas Veithen updated AXIS2-5273:
-----------------------------------
    Description: 
[AXIS2-4859] has been patched adding the -Eiu option to ignore unexpected elements. However,
to truly be forward-compatible, generated code should also ignore unexpected enumeration values.
Here's the snippet necessary for the adb code generation. I opted to return null when an unexpected
enumeration is found, as opposed to skip it:

ADBBeanTemplate-bean.xsl line 2135:

{code}
                    // handle unexpected enumeration values properly
                    <xsl:if test="$ignoreunexpected">
                        log.warn("Unexpected value " + value + " for enumeration <xsl:value-of
select="$name"/>");
                        return enumeration;
                    </xsl:if>
                    <xsl:if test="not($ignoreunexpected)">
                        if ((enumeration == null) &amp;&amp; !((value == null) ||
(value.equals("")))) {
                            throw new java.lang.IllegalArgumentException();
                        }
                        return enumeration;
                    </xsl:if>
{code}


  was:
[AXIS2-4859] has been patched adding the -Eiu option to ignore unexpected elements. However,
to truly be forward-compatible, generated code should also ignore unexpected enumeration values.
Here's the snippet necessary for the adb code generation. I opted to return null when an unexpected
enumeration is found, as opposed to skip it:

ADBBeanTemplate-bean.xsl line 2135:

                    // handle unexpected enumeration values properly
                    <xsl:if test="$ignoreunexpected">
                        log.warn("Unexpected value " + value + " for enumeration <xsl:value-of
select="$name"/>");
                        return enumeration;
                    </xsl:if>
                    <xsl:if test="not($ignoreunexpected)">
                        if ((enumeration == null) &amp;&amp; !((value == null) ||
(value.equals("")))) {
                            throw new java.lang.IllegalArgumentException();
                        }
                        return enumeration;
                    </xsl:if>



> Allow forward-compatibility by ignoring unexpected enumeration values
> ---------------------------------------------------------------------
>
>                 Key: AXIS2-5273
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5273
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb, codegen
>    Affects Versions: nightly
>            Reporter: Cleber Zarate
>            Priority: Minor
>              Labels: adb, adb-codegen, enumeration, restriction
>             Fix For: 1.7.0
>
>         Attachments: favoriteCharacters_client_afterPatch.zip, favoriteCharacters_client_beforePatch.zip,
favoriteCharacters_service_new_enumeration_value.zip, favoriteCharacters_service_original_enumeration_values.zip,
patch.txt
>
>
> [AXIS2-4859] has been patched adding the -Eiu option to ignore unexpected elements. However,
to truly be forward-compatible, generated code should also ignore unexpected enumeration values.
> Here's the snippet necessary for the adb code generation. I opted to return null when
an unexpected enumeration is found, as opposed to skip it:
> ADBBeanTemplate-bean.xsl line 2135:
> {code}
>                     // handle unexpected enumeration values properly
>                     <xsl:if test="$ignoreunexpected">
>                         log.warn("Unexpected value " + value + " for enumeration <xsl:value-of
select="$name"/>");
>                         return enumeration;
>                     </xsl:if>
>                     <xsl:if test="not($ignoreunexpected)">
>                         if ((enumeration == null) &amp;&amp; !((value == null)
|| (value.equals("")))) {
>                             throw new java.lang.IllegalArgumentException();
>                         }
>                         return enumeration;
>                     </xsl:if>
> {code}



--
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


Mime
View raw message