Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5273

Allow forward-compatibility by ignoring unexpected enumeration values

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      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>
      

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cleber.zarate Cleber Zarate

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment