You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Cleber Zarate (Created) (JIRA)" <ji...@apache.org> on 2012/03/19 16:16:37 UTC

[jira] [Created] (AXIS2-5273) Allows forward-compatibility by ignoring unexpected enumeration values

Allows 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: 1.7.0
            Reporter: Cleber Zarate
            Priority: Minor


[AXIS2-4859] has been patched adding the -Eiu option to ignore unexpected elements. However, to truly be forward-compatibly, 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>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (AXIS2-5273) Allow forward-compatibility by ignoring unexpected enumeration values

Posted by "Cleber Zarate (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cleber Zarate updated AXIS2-5273:
---------------------------------

    Attachment: favoriteCharacters_service_original_enumeration_values.zip
                favoriteCharacters_service_new_enumeration_value.zip
                favoriteCharacters_client_beforePatch.zip
                favoriteCharacters_client_afterPatch.zip

file favoriteCharacters_service_original_enumeration_values.zip contains a simple service that exposes a method that returns an enumeration with 4 values. 
favoriteCharacters_service_new_enumeration_value.zip is a newer version of the previous service, which happens to add a new value in the enumeration (now 5 values total).
File favoriteCharacters_client_beforePatch.zip contains a client project generated against the original service WSDL (containing 4 values). When pointed to the new service, an IllegalArgumentException is thrown.
File favoriteCharacters_client_afterPatch.zip contains the same client project generated against the original service WSDL (4 values), however because of the patch, it won't throw any exceptions when pointing to the new service.
The binding will return null when it encounters the unexpected new enumeration value.
                
> 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: 1.7.0
>            Reporter: Cleber Zarate
>            Priority: Minor
>              Labels: adb, adb-codegen, enumeration, restriction
>         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:
>                     // 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (AXIS2-5273) Allows forward-compatibility by ignoring unexpected enumeration values

Posted by "Cleber Zarate (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cleber Zarate updated AXIS2-5273:
---------------------------------

    Attachment: patch.txt

Patch for ignoring unexpected enumeration values
                
> Allows 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: 1.7.0
>            Reporter: Cleber Zarate
>            Priority: Minor
>              Labels: adb, adb-codegen, enumeration, restriction
>         Attachments: patch.txt
>
>
> [AXIS2-4859] has been patched adding the -Eiu option to ignore unexpected elements. However, to truly be forward-compatibly, 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (AXIS2-5273) Allow forward-compatibility by ignoring unexpected enumeration values

Posted by "Sagara Gunathunga (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232683#comment-13232683 ] 

Sagara Gunathunga  commented on AXIS2-5273:
-------------------------------------------

Can you attach a test case or a sample service (source code) you used to test this patch ? 
                
> 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: 1.7.0
>            Reporter: Cleber Zarate
>            Priority: Minor
>              Labels: adb, adb-codegen, enumeration, restriction
>         Attachments: 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:
>                     // 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Resolved] (AXIS2-5273) Allow forward-compatibility by ignoring unexpected enumeration values

Posted by "Sagara Gunathunga (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sagara Gunathunga  resolved AXIS2-5273.
---------------------------------------

    Resolution: Fixed

Patch available on r1304272. 
                
> 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:
>                     // 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (AXIS2-5273) Allow forward-compatibility by ignoring unexpected enumeration values

Posted by "Cleber Zarate (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cleber Zarate updated AXIS2-5273:
---------------------------------

    Summary: Allow forward-compatibility by ignoring unexpected enumeration values  (was: Allows forward-compatibility by ignoring unexpected enumeration values)
    
> 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: 1.7.0
>            Reporter: Cleber Zarate
>            Priority: Minor
>              Labels: adb, adb-codegen, enumeration, restriction
>         Attachments: 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:
>                     // 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (AXIS2-5273) Allow forward-compatibility by ignoring unexpected enumeration values

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236524#comment-13236524 ] 

Hudson commented on AXIS2-5273:
-------------------------------

Integrated in Axis2 #1314 (See [https://builds.apache.org/job/Axis2/1314/])
    Applied patch for AXIS2-5273. (Revision 1304272)

     Result = SUCCESS
sagara : 
Files : 
* /axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl

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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (AXIS2-5273) Allow forward-compatibility by ignoring unexpected enumeration values

Posted by "Sagara Gunathunga (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sagara Gunathunga  updated AXIS2-5273:
--------------------------------------

    Affects Version/s:     (was: 1.7.0)
                       nightly
        Fix Version/s: 1.7.0
    
> 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:
>                     // 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (AXIS2-5273) Allows forward-compatibility by ignoring unexpected enumeration values

Posted by "Cleber Zarate (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cleber Zarate 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:

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


  was:
[AXIS2-4859] has been patched adding the -Eiu option to ignore unexpected elements. However, to truly be forward-compatibly, 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>


    
> Allows 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: 1.7.0
>            Reporter: Cleber Zarate
>            Priority: Minor
>              Labels: adb, adb-codegen, enumeration, restriction
>         Attachments: 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:
>                     // 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>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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