8029800: Flags.java uses String.toLowerCase without specifying Locale

Introducing StringUtils.toLowerCase/toUpperCase independent on the default locale, converting almost all usages of String.toLowerCase/toUpperCase to use the new methods.

Reviewed-by: jjg, bpatel
This commit is contained in:
Jan Lahoda 2013-12-17 10:55:59 +01:00
parent b06d1bfb55
commit 8ebb81fb7a
28 changed files with 336 additions and 67 deletions

View file

@ -62,6 +62,7 @@ import com.sun.tools.classfile.StackMap_attribute;
import com.sun.tools.classfile.Synthetic_attribute;
import static com.sun.tools.classfile.AccessFlags.*;
import com.sun.tools.javac.util.StringUtils;
/*
* A writer for writing Attributes as text.
@ -717,14 +718,14 @@ public class AttributeWriter extends BasicWriter
}
static String toHex(int i) {
return Integer.toString(i, 16).toUpperCase();
return StringUtils.toUpperCase(Integer.toString(i, 16));
}
static String toHex(int i, int w) {
String s = Integer.toHexString(i).toUpperCase();
String s = StringUtils.toUpperCase(Integer.toHexString(i));
while (s.length() < w)
s = "0" + s;
return s.toUpperCase();
return StringUtils.toUpperCase(s);
}
private AnnotationWriter annotationWriter;