aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsundar <none@none>2013-05-28 16:37:11 +0530
committersundar <none@none>2013-05-28 16:37:11 +0530
commit5ba3f4c0589592859fb340110bcc47a38517674b (patch)
treee7d10aaccc0f874a1d5d3221ebbf535a8d2a0935
parenta4fc326bd5ec1eb73f5bc78f6c5bc27d2bfd6d7e (diff)
downloadnashorn-5ba3f4c0589592859fb340110bcc47a38517674b.tar.gz
8015459: Octane test run fails on Turkish locale
Reviewed-by: lagergren, attila
-rw-r--r--src/jdk/nashorn/internal/codegen/CodeGenerator.java3
-rw-r--r--src/jdk/nashorn/internal/objects/DateParser.java5
-rw-r--r--src/jdk/nashorn/internal/parser/TokenType.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/GlobalFunctions.java5
-rw-r--r--src/jdk/nashorn/internal/runtime/JSType.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/Logging.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/ScriptRuntime.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/options/OptionTemplate.java2
8 files changed, 17 insertions, 10 deletions
diff --git a/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/src/jdk/nashorn/internal/codegen/CodeGenerator.java
index aae2fd2d..21b61cd8 100644
--- a/src/jdk/nashorn/internal/codegen/CodeGenerator.java
+++ b/src/jdk/nashorn/internal/codegen/CodeGenerator.java
@@ -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());
diff --git a/src/jdk/nashorn/internal/objects/DateParser.java b/src/jdk/nashorn/internal/objects/DateParser.java
index 544525b1..b66d3dc9 100644
--- a/src/jdk/nashorn/internal/objects/DateParser.java
+++ b/src/jdk/nashorn/internal/objects/DateParser.java
@@ -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
diff --git a/src/jdk/nashorn/internal/parser/TokenType.java b/src/jdk/nashorn/internal/parser/TokenType.java
index 657c8c46..92f3ad74 100644
--- a/src/jdk/nashorn/internal/parser/TokenType.java
+++ b/src/jdk/nashorn/internal/parser/TokenType.java
@@ -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() {
diff --git a/src/jdk/nashorn/internal/runtime/GlobalFunctions.java b/src/jdk/nashorn/internal/runtime/GlobalFunctions.java
index 91011533..98b79150 100644
--- a/src/jdk/nashorn/internal/runtime/GlobalFunctions.java
+++ b/src/jdk/nashorn/internal/runtime/GlobalFunctions.java
@@ -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));
}
}
diff --git a/src/jdk/nashorn/internal/runtime/JSType.java b/src/jdk/nashorn/internal/runtime/JSType.java
index 58669144..8f1f1e9e 100644
--- a/src/jdk/nashorn/internal/runtime/JSType.java
+++ b/src/jdk/nashorn/internal/runtime/JSType.java
@@ -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);
}
/**
diff --git a/src/jdk/nashorn/internal/runtime/Logging.java b/src/jdk/nashorn/internal/runtime/Logging.java
index 8a69ebf9..39740dd2 100644
--- a/src/jdk/nashorn/internal/runtime/Logging.java
+++ b/src/jdk/nashorn/internal/runtime/Logging.java
@@ -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);
diff --git a/src/jdk/nashorn/internal/runtime/ScriptRuntime.java b/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
index 216b381c..25dccb7b 100644
--- a/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
+++ b/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
@@ -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));
}
/**
diff --git a/src/jdk/nashorn/internal/runtime/options/OptionTemplate.java b/src/jdk/nashorn/internal/runtime/options/OptionTemplate.java
index 62dcbb8d..4c1c44fc 100644
--- a/src/jdk/nashorn/internal/runtime/options/OptionTemplate.java
+++ b/src/jdk/nashorn/internal/runtime/options/OptionTemplate.java
@@ -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;