RFR: 8356202: Cleanup Source code in String Implementation Classes [v2]

Raffaello Giulietti rgiulietti at openjdk.org
Thu Oct 2 16:17:35 UTC 2025


On Thu, 2 Oct 2025 16:14:45 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Code cleanup in java.lang.StringLatin1 and StringUTF16.
>> Remove the `public` qualifier from methods where it is not needed.
>> Remove an unused toBytes method.
>> Remove unused codePointXXX methods.
>> Remove unnecessary casts of primitive types.
>> 
>> Some of these are suggested by IntelliJ, if the advice should not be taken, I'll revert and update the IDE settings.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert to insensitive.

src/java.base/share/classes/java/lang/StringLatin1.java line 217:

> 215: 
> 216:     @IntrinsicCandidate
> 217:     static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) {

I guess that removing `public` needs no changes in the intrinsic implementation?

src/java.base/share/classes/java/lang/StringLatin1.java line 367:

> 365:     }
> 366: 
> 367:     // case in-sensitive

What's wrong with the original `case insensitive`?
I checked in online dictionaries, "insensitive" is correct, despite what the IDE reports.

src/java.base/share/classes/java/lang/StringUTF16.java line 542:

> 540:     }
> 541: 
> 542:     // Case in-sensitive comparison of two code points

Same as above

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27609#discussion_r2399322327
PR Review Comment: https://git.openjdk.org/jdk/pull/27609#discussion_r2399323804
PR Review Comment: https://git.openjdk.org/jdk/pull/27609#discussion_r2399340946


More information about the core-libs-dev mailing list