Author: sagara
Date: Fri Mar 23 10:39:54 2012
New Revision: 1304272

URL: http://svn.apache.org/viewvc?rev=1304272&view=rev
Log:
Applied patch for AXIS2-5273.

Modified:
    
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl

Modified: 
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl?rev=1304272&r1=1304271&r2=1304272&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
 Fri Mar 23 10:39:54 2012
@@ -2132,10 +2132,17 @@
                            </xsl:otherwise>
                        </xsl:choose>
 
-                    if ((enumeration == null) &amp;&amp; !((value == null) || 
(value.equals("")))) {
-                        throw new java.lang.IllegalArgumentException();
-                    }
-                    return enumeration;
+                    // 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>
                 }
                 public static <xsl:value-of select="$name"/> 
fromString(java.lang.String value,java.lang.String namespaceURI)
                       throws java.lang.IllegalArgumentException {


Reply via email to