RFR: 8282279: Interpret case-insensitive string locale independently

Bernd Eckenfels ecki at zusammenkunft.net
Wed Feb 23 08:52:04 UTC 2022


The last replace seems a bit strange, I would expect it should first normalize the case and then the hyphen, otherwise it won’t match the replace?

Looks to me like not using toUpperCase in the trace messages would be more efficient and produces shorter code.

Isn’t it customary to use the ROOT locale instead of ENGLISH?
Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: security-dev <security-dev-retn at openjdk.java.net> im Auftrag von Xue-Lei Andrew Fan <xuelei at openjdk.java.net>
Gesendet: Wednesday, February 23, 2022 1:12:16 AM
An: security-dev at openjdk.java.net <security-dev at openjdk.java.net>
Betreff: RFR: 8282279: Interpret case-insensitive string locale independently

The String.toUpperCase() or String.toLowerCase() method is locale sensitive, and may produce unexpected results if used for strings that are intended to be interpreted locale independently.  The use of the two methods had been cleaned before, but there are a few new introduced laterly.

See https://www.ivi.co/java/2011/07/07/4878.html for examples.

-------------

Commit messages:
 - 8282279: Interpret case-insensitive string locale independently

Changes: https://git.openjdk.java.net/jdk/pull/7583/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7583&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8282279
  Stats: 18 lines in 5 files changed: 5 ins; 0 del; 13 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7583.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7583/head:pull/7583

PR: https://git.openjdk.java.net/jdk/pull/7583
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/security-dev/attachments/20220223/6c7a1851/attachment.htm>


More information about the security-dev mailing list