OSDN Git Service

If dalvik wants ASCII casing, it needs to ask for it.
authorElliott Hughes <enh@google.com>
Fri, 2 Aug 2013 17:34:29 +0000 (10:34 -0700)
committerElliott Hughes <enh@google.com>
Fri, 2 Aug 2013 17:34:29 +0000 (10:34 -0700)
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html

Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: I1601cda215ebc5995117323e40a684ad352fe733

dx/src/com/android/dx/command/annotool/Main.java

index 14d7373..b05287c 100644 (file)
@@ -18,7 +18,7 @@ package com.android.dx.command.annotool;
 
 import java.lang.annotation.ElementType;
 import java.util.EnumSet;
-
+import java.util.Locale;
 
 public class Main {
 
@@ -42,7 +42,7 @@ public class Main {
 
     static class Arguments {
         /**
-         * from --annotation, dot-seperated classname
+         * from --annotation, dot-separated classname
          * of annotation to look for
          */
         String aclass;
@@ -75,7 +75,7 @@ public class Main {
 
                     try {
                         for (String p : argParam.split(",")) {
-                            eTypes.add(ElementType.valueOf(p.toUpperCase()));
+                            eTypes.add(ElementType.valueOf(p.toUpperCase(Locale.ROOT)));
                         }
                     } catch (IllegalArgumentException ex) {
                         throw new InvalidArgumentException(
@@ -86,7 +86,7 @@ public class Main {
 
                     try {
                         for (String p : argParam.split(",")) {
-                            printTypes.add(PrintType.valueOf(p.toUpperCase()));
+                            printTypes.add(PrintType.valueOf(p.toUpperCase(Locale.ROOT)));
                         }
                     } catch (IllegalArgumentException ex) {
                         throw new InvalidArgumentException("invalid --print");