ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r631928 - /webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/constants/Enum.java
Date Thu, 28 Feb 2008 11:00:13 GMT
Author: deepal
Date: Thu Feb 28 03:00:10 2008
New Revision: 631928

URL: http://svn.apache.org/viewvc?rev=631928&view=rev
Log:
fixing https://issues.apache.org/jira/browse/WSCOMMONS-273 in the trunk which is fixed in
the branch but due to some reason which is not there 

Modified:
    webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/constants/Enum.java

Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/constants/Enum.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/constants/Enum.java?rev=631928&r1=631927&r2=631928&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/constants/Enum.java
(original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/constants/Enum.java
Thu Feb 28 03:00:10 2008
@@ -39,17 +39,26 @@
         if (value.equals(Enum.NULL))
             this.value = Enum.NULL;
         else {
-            String values[] = getValues();
-            for (int i = 0; i < values.length; i++) {
-                if (values[i].equals(value)) {
-                    this.value = value;
-                    break;
+            //the value can be a list of space seperated items
+            String possibleValues[] = getValues();
+            String[] valuesToBeTested = value.split("\\s");
+            for (int i = 0; i < valuesToBeTested.length; i++) {
+                for (int j = 0; j < possibleValues.length; j++) {
+                    if (possibleValues[j].equals(valuesToBeTested[i])) {
+                        break;
+                    }
+                    if (i == possibleValues.length - 1)
+                        throw new EnumValueException("Bad Enumeration value '" + value +
"'");
                 }
-                if (i == values.length - 1)
-                    throw new EnumValueException("Bad Enumeration value '" + value + "'");
             }
+
+            //when we reach here we have tested all the values to be correct (applicable)
+             this.value = value;
+
+
         }
     }
+
 
     public String getValue() {
         return value;



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


Mime
View raw message