summaryrefslogtreecommitdiffstats
path: root/support/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-08-02 10:19:26 -0700
committerElliott Hughes <enh@google.com>2013-08-02 10:19:26 -0700
commitb274574b7e2681f4411852af9857b4540bf75841 (patch)
tree39c695d0c431ab82b52e2f187115cba48a671b5b /support/src
parent4d00c09ea8f976dd5d4a82cf6c874abcd78e6f15 (diff)
downloadlibcore-b274574b7e2681f4411852af9857b4540bf75841.zip
libcore-b274574b7e2681f4411852af9857b4540bf75841.tar.gz
libcore-b274574b7e2681f4411852af9857b4540bf75841.tar.bz2
If libcore wants ASCII casing, it needs to ask for it like everyone else.
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html Bug: https://code.google.com/p/android/issues/detail?id=58359 Change-Id: I597b2ac940f17b5b2bc176e390dc4b63fe0a4e72
Diffstat (limited to 'support/src')
-rw-r--r--support/src/test/java/libcore/java/security/StandardNames.java5
-rw-r--r--support/src/test/java/tests/http/MockWebServer.java3
2 files changed, 5 insertions, 3 deletions
diff --git a/support/src/test/java/libcore/java/security/StandardNames.java b/support/src/test/java/libcore/java/security/StandardNames.java
index 6b42a2e..bb9aeda 100644
--- a/support/src/test/java/libcore/java/security/StandardNames.java
+++ b/support/src/test/java/libcore/java/security/StandardNames.java
@@ -31,6 +31,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.crypto.spec.DHPrivateKeySpec;
@@ -99,12 +100,12 @@ public final class StandardNames extends Assert {
PROVIDER_ALGORITHMS.put(type, algorithms);
}
assertTrue("Duplicate " + type + " " + algorithm,
- algorithms.add(algorithm.toUpperCase()));
+ algorithms.add(algorithm.toUpperCase(Locale.ROOT)));
}
private static void unprovide(String type, String algorithm) {
Set<String> algorithms = PROVIDER_ALGORITHMS.get(type);
assertNotNull(algorithms);
- assertTrue(algorithm, algorithms.remove(algorithm.toUpperCase()));
+ assertTrue(algorithm, algorithms.remove(algorithm.toUpperCase(Locale.ROOT)));
if (algorithms.isEmpty()) {
assertNotNull(PROVIDER_ALGORITHMS.remove(type));
}
diff --git a/support/src/test/java/tests/http/MockWebServer.java b/support/src/test/java/tests/http/MockWebServer.java
index 0e950c6..1b776b2 100644
--- a/support/src/test/java/tests/http/MockWebServer.java
+++ b/support/src/test/java/tests/http/MockWebServer.java
@@ -36,6 +36,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
@@ -345,7 +346,7 @@ public final class MockWebServer {
String header;
while (!(header = readAsciiUntilCrlf(in)).isEmpty()) {
headers.add(header);
- String lowercaseHeader = header.toLowerCase();
+ String lowercaseHeader = header.toLowerCase(Locale.ROOT);
if (contentLength == -1 && lowercaseHeader.startsWith("content-length:")) {
contentLength = Integer.parseInt(header.substring(15).trim());
}