Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: XmlSchema 2.0
    • Fix Version/s: 2.0.2
    • Labels:
      None

      Description

      The EnumUtils class used to parse the enums does:

          
          static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name) {
              return Enum.valueOf(enumClass, name.toUpperCase());
          }
      

      but the toUpperCase call there is locale specific and could result in not being able to parse the enums.

        Activity

        Daniel Kulp created issue -
        Hide
        Ali added a comment -

        I included following modified version of EnumUtil in my project, and it solved the error "java.lang.IllegalArgumentException: No enum const class org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED". Until the issue is fixed, this is the workaround for me..

        package org.apache.ws.commons.schema;

        import java.util.Locale;

        /**

        • @author Ali Pakkan
        • */
          public class EnumUtil {
          private EnumUtil() {
          }
          static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name)

          { return Enum.valueOf(enumClass, name.toUpperCase(Locale.ENGLISH)); }

          }

        Show
        Ali added a comment - I included following modified version of EnumUtil in my project, and it solved the error "java.lang.IllegalArgumentException: No enum const class org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED". Until the issue is fixed, this is the workaround for me.. — package org.apache.ws.commons.schema; import java.util.Locale; /** @author Ali Pakkan */ public class EnumUtil { private EnumUtil() { } static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name) { return Enum.valueOf(enumClass, name.toUpperCase(Locale.ENGLISH)); } }
        Daniel Kulp made changes -
        Field Original Value New Value
        Assignee Daniel Kulp [ dkulp ]
        Daniel Kulp made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.2 [ 12317977 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in xmlschema-trunk-jdk15 #20 (See https://builds.apache.org/job/xmlschema-trunk-jdk15/20/)
        XMLSCHEMA-22 Use the english locale for parsing enums to avoid issues
        with local locals making the toUpperCase call not yield usable results. (Revision 1308394)

        Result = SUCCESS
        dkulp :
        Files :

        • /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/EnumUtil.java
        Show
        Hudson added a comment - Integrated in xmlschema-trunk-jdk15 #20 (See https://builds.apache.org/job/xmlschema-trunk-jdk15/20/ ) XMLSCHEMA-22 Use the english locale for parsing enums to avoid issues with local locals making the toUpperCase call not yield usable results. (Revision 1308394) Result = SUCCESS dkulp : Files : /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/EnumUtil.java

          People

          • Assignee:
            Daniel Kulp
            Reporter:
            Daniel Kulp
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development