提交 5244f978 编写于 作者: S sundar

8015459: Octane test run fails on Turkish locale

Reviewed-by: lagergren, attila
上级 3d2cf429
......@@ -58,6 +58,7 @@ import java.util.EnumSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.TreeMap;
import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
......@@ -2220,7 +2221,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
}
method.convert(Type.OBJECT);
} else if (value instanceof Boolean) {
method.getField(staticField(Boolean.class, value.toString().toUpperCase(), Boolean.class));
method.getField(staticField(Boolean.class, value.toString().toUpperCase(Locale.ENGLISH), Boolean.class));
} else {
load(rhs);
method.convert(unaryNode.getType());
......
......@@ -32,6 +32,7 @@ import static java.lang.Character.SPACE_SEPARATOR;
import static java.lang.Character.UPPERCASE_LETTER;
import java.util.HashMap;
import java.util.Locale;
/**
* JavaScript date parser. This class first tries to parse a date string
......@@ -486,7 +487,7 @@ public class DateParser {
while (pos < limit && isAsciiLetter(string.charAt(pos))) {
pos++;
}
final String key = string.substring(start, pos).toLowerCase();
final String key = string.substring(start, pos).toLowerCase(Locale.ENGLISH);
final Name name = names.get(key);
// then advance to end of name
while (pos < length && isAsciiLetter(string.charAt(pos))) {
......@@ -683,7 +684,7 @@ public class DateParser {
Name(final String name, final int type, final int value) {
assert name != null;
assert name.equals(name.toLowerCase());
assert name.equals(name.toLowerCase(Locale.ENGLISH));
this.name = name;
// use first three characters as lookup key
......
......@@ -25,6 +25,7 @@
package jdk.nashorn.internal.parser;
import java.util.Locale;
import static jdk.nashorn.internal.parser.TokenKind.BINARY;
import static jdk.nashorn.internal.parser.TokenKind.BRACKET;
import static jdk.nashorn.internal.parser.TokenKind.FUTURE;
......@@ -249,7 +250,7 @@ public enum TokenType {
}
public String getNameOrType() {
return name == null ? super.name().toLowerCase() : name;
return name == null ? super.name().toLowerCase(Locale.ENGLISH) : name;
}
public TokenType getNext() {
......
......@@ -30,6 +30,7 @@ import static jdk.nashorn.internal.lookup.Lookup.MH;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.util.Locale;
/**
* Utilities used by Global class.
......@@ -373,10 +374,10 @@ loop:
} else if (ch < 256) {
sb.append('%');
final byte b = (byte)ch;
sb.append(Integer.toHexString(b & 0xFF).toUpperCase());
sb.append(Integer.toHexString(b & 0xFF).toUpperCase(Locale.ENGLISH));
} else {
sb.append("%u");
sb.append(Integer.toHexString(ch & 0xFFFF).toUpperCase());
sb.append(Integer.toHexString(ch & 0xFFFF).toUpperCase(Locale.ENGLISH));
}
}
......
......@@ -28,6 +28,7 @@ package jdk.nashorn.internal.runtime;
import static jdk.nashorn.internal.codegen.CompilerConstants.staticCall;
import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
import java.util.Locale;
import jdk.internal.dynalink.beans.StaticClass;
import jdk.nashorn.internal.codegen.CompilerConstants.Call;
import jdk.nashorn.internal.parser.Lexer;
......@@ -111,7 +112,7 @@ public enum JSType {
*/
public final String typeName() {
// For NULL, "object" has to be returned!
return ((this == NULL) ? OBJECT : this).name().toLowerCase();
return ((this == NULL) ? OBJECT : this).name().toLowerCase(Locale.ENGLISH);
}
/**
......
......@@ -26,6 +26,7 @@
package jdk.nashorn.internal.runtime;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.ConsoleHandler;
......@@ -117,7 +118,7 @@ public final class Logging {
if ("".equals(value)) {
level = Level.INFO;
} else {
level = Level.parse(value.toUpperCase());
level = Level.parse(value.toUpperCase(Locale.ENGLISH));
}
final String name = Logging.lastPart(key);
......
......@@ -36,6 +36,7 @@ import java.lang.invoke.MethodHandle;
import java.lang.reflect.Array;
import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.Objects;
import jdk.internal.dynalink.beans.StaticClass;
......@@ -788,7 +789,7 @@ public final class ScriptRuntime {
return false;
}
throw typeError("in.with.non.object", rvalType.toString().toLowerCase());
throw typeError("in.with.non.object", rvalType.toString().toLowerCase(Locale.ENGLISH));
}
/**
......
......@@ -267,7 +267,7 @@ public class OptionTemplate implements Comparable<OptionTemplate> {
this.params = arg;
break;
case "type":
this.type = arg.toLowerCase(Locale.ROOT);
this.type = arg.toLowerCase(Locale.ENGLISH);
break;
case "default":
this.defaultValue = arg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册