7065228: To interpret case-insensitive string locale independently

Reviewed-by: dfuchs, naoto, djelinski, jpai, michaelm
This commit is contained in:
Darragh Clarke 2023-05-22 10:53:59 +00:00 committed by Jaikiran Pai
parent a9705196ce
commit 05e99db466
20 changed files with 74 additions and 60 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
package java.net;
import java.io.IOException;
import java.util.Locale;
import java.util.Objects;
import sun.net.util.IPAddressUtil;
@ -374,7 +375,7 @@ public abstract class URLStreamHandler {
} else {
String host = u.getHost();
if (host != null)
h += host.toLowerCase().hashCode();
h += host.toLowerCase(Locale.ROOT).hashCode();
}
// Generate the file part.