JDK-8151384 : Improve String.CASE_INSENSITIVE_ORDER and remove sun.misc.ASCIICaseInsensitiveComparator
  • Type: Sub-task
  • Component: core-libs
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-03-07
  • Updated: 2022-08-10
  • Resolved: 2016-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b110Fixed
Related Reports
Relates :  
Description
sun.misc.ASCIICaseInsensitiveComparator appears to be a specialized comparator for comparing
strings that contain only ASCII characters. Its main usage seems to be in sorted maps that support the
character set implementation. It looks like an optimized version of Strings public case sensitive
comparator, when the strings are known to contain only ASCII characters. The public string case
insensitive comparator, in some cases, does a toUpperCase and a toLowerCase.
ASCIICaseInsensitiveComparator is trying to avoid this.

Looking at String.CASE_INSENSITIVE_ORDER it looks like it can be, somewhat easily, optimized to give
similar performance to that of ASCIICaseInsensitiveComparator without much risk.  This will allow
usages of ASCIICaseInsensitiveComparator to be replaced with String.CASE_INSENSITIVE_ORDER. 

Note: this issue is not intending to optimize String.CASE_INSENSITIVE_ORDER as much as possible,
just to make reasonable changes that improve performance to a point where it is a reasonable
replacement for ASCIICaseInsensitiveComparator. Further optimization should not be prevented,
or twarted, by this work.
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/c82be424393e User: lana Date: 2016-03-14 15:55:07 +0000
14-03-2016

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/c82be424393e User: chegar Date: 2016-03-08 12:14:26 +0000
08-03-2016

Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-March/039333.html
08-03-2016