RFR: 8147962: URL should handle lower-casing of protocol locale-independently

Alan Bateman Alan.Bateman at oracle.com
Fri Jan 22 11:29:30 UTC 2016



On 21/01/2016 17:27, Claes Redestad wrote:
> Hi,
>
> using String.toLowerCase() in URL allows some strings to lower-case to 
> a string that'd be invalid, e.g. "FILE".toLowerCase() -> "f\u0131le" 
> in turkish locales.
>
> This patch suggests using the locale-independent 
> String.toLowerCase(Locale.ENGLISH) instead, since only a-z and A-Z are 
> legal alphabeticals according to spec.
>
> Webrev: http://cr.openjdk.java.net/~redestad/8147962/webrev.01/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8147962
The change to URL looks okay but be warned that URL has bitten the 
fingers of many that have dared to touch it. So we'll need to keep an 
eye out for any side effects/bug reports.

For the test then maybe it could iterate over all locales rather than 
just test with tr. Also good for the test to run in othervm mode, I 
can't recall off hand if jtreg resets the locale when in agent VM mode 
(the default in our testing these days).

-Alan.


More information about the net-dev mailing list