# HG changeset patch # User chegar # Date 1523283048 -3600 # Node ID 5c29612f27b4e8ce9e8efd00e792a350680269f4 # Parent 84a8fa6849985ced319af1f6eb480a859c2c912b http-client-branch: review comment - specify locale consistently in toLowerCase diff -r 84a8fa684998 -r 5c29612f27b4 src/java.net.http/share/classes/jdk/internal/net/http/HeaderParser.java --- a/src/java.net.http/share/classes/jdk/internal/net/http/HeaderParser.java Mon Apr 09 12:59:06 2018 +0100 +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HeaderParser.java Mon Apr 09 15:10:48 2018 +0100 @@ -142,7 +142,7 @@ tab[i++][1] = (new String(ca, beg, end-beg+1)); } } else { - tab[i++][0] = (new String(ca, beg, end-beg+1)).toLowerCase(); + tab[i++][0] = (new String(ca, beg, end-beg+1)).toLowerCase(Locale.US); } } else if (end == beg) { if (!inKey) { @@ -152,7 +152,7 @@ tab[i++][1] = String.valueOf(ca[end]); } } else { - tab[i++][0] = String.valueOf(ca[end]).toLowerCase(); + tab[i++][0] = String.valueOf(ca[end]).toLowerCase(Locale.US); } } nkeys=i; diff -r 84a8fa684998 -r 5c29612f27b4 src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java Mon Apr 09 12:59:06 2018 +0100 +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java Mon Apr 09 15:10:48 2018 +0100 @@ -36,6 +36,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.CompletableFuture; @@ -426,7 +427,7 @@ return keyString(isSecure, isProxy, addr.getHostString(), addr.getPort()); } - + static String keyFor(URI uri, InetSocketAddress proxy) { boolean isSecure = uri.getScheme().equalsIgnoreCase("https"); boolean isProxy = proxy != null; @@ -960,7 +961,7 @@ List buffers = new ArrayList<>(); for(HttpHeaders header : headers) { for (Map.Entry> e : header.map().entrySet()) { - String lKey = e.getKey().toLowerCase(); + String lKey = e.getKey().toLowerCase(Locale.US); List values = e.getValue(); for (String value : values) { hpackOut.header(lKey, value); diff -r 84a8fa684998 -r 5c29612f27b4 src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java --- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java Mon Apr 09 12:59:06 2018 +0100 +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java Mon Apr 09 15:10:48 2018 +0100 @@ -27,6 +27,7 @@ import java.net.URI; import java.time.Duration; +import java.util.Locale; import java.util.Optional; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -76,7 +77,7 @@ String scheme = uri.getScheme(); if (scheme == null) throw newIAE("URI with undefined scheme"); - scheme = scheme.toLowerCase(); + scheme = scheme.toLowerCase(Locale.US); if (!(scheme.equals("https") || scheme.equals("http"))) { throw newIAE("invalid URI scheme %s", scheme); } diff -r 84a8fa684998 -r 5c29612f27b4 src/java.net.http/share/classes/jdk/internal/net/http/common/Log.java --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/Log.java Mon Apr 09 12:59:06 2018 +0100 +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/Log.java Mon Apr 09 15:10:48 2018 +0100 @@ -115,7 +115,7 @@ frametypes = CONTROL | DATA | WINDOW_UPDATES; } else { for (String type : types) { - switch (type.toLowerCase()) { + switch (type.toLowerCase(Locale.US)) { case "control": frametypes |= CONTROL; break;