Call String.toLowerCase and .toUppercase with explicit locale

Closes gh-42719
This commit is contained in:
Moritz Halbritter
2024-10-17 13:20:15 +02:00
parent 666e0c1a53
commit a3060652f8
25 changed files with 54 additions and 29 deletions

View File

@@ -18,6 +18,7 @@ package org.springframework.boot.loader.net.protocol.jar;
import java.lang.ref.SoftReference;
import java.net.URL;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -54,10 +55,10 @@ final class JarFileUrlKey {
String host = url.getHost();
int port = (url.getPort() != -1) ? url.getPort() : url.getDefaultPort();
String file = url.getFile();
value.append(protocol.toLowerCase());
value.append(protocol.toLowerCase(Locale.ROOT));
value.append(":");
if (host != null && !host.isEmpty()) {
value.append(host.toLowerCase());
value.append(host.toLowerCase(Locale.ROOT));
value.append((port != -1) ? ":" + port : "");
}
value.append((file != null) ? file : "");