RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v3]

Aleksei Voitylov avoitylov at openjdk.org
Tue Sep 26 16:18:31 UTC 2023


On Tue, 26 Sep 2023 14:29:05 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update src/java.base/share/classes/java/lang/String.java
>>   
>>   Co-authored-by: Raffaello Giulietti <raffaello.giulietti at oracle.com>
>
> src/java.base/share/classes/java/lang/String.java line 2162:
> 
>> 2160:         if (len < 0) {
>> 2161:            return true;
>> 2162:         }
> 
> Isn't it also true that the regions trivial match if len == 0?

Yes, you are right. The statement "there is some nonnegative integer k less than len " covers the case len == 0, and the rest of the cases are checked before this line.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15906#discussion_r1337471588


More information about the core-libs-dev mailing list