RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]
Roger Riggs
rriggs at openjdk.org
Wed Sep 27 13:30:30 UTC 2023
On Wed, 27 Sep 2023 09:58:58 GMT, Aleksei Voitylov <avoitylov at openjdk.org> wrote:
>> test java.lang.String.RegionMatches1Tests fails on all platforms with -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by default. The fix is to return true immediately if len is negative, since for negative length this condition will never be satisfied.
>>
>> Testing: JCK, JTREG passed with the fix with -XX:-CompactStrings on x86_64 and on ARM32.
>
> Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision:
>
> address review comments
Changes requested by rriggs (Reviewer).
test/jdk/java/lang/String/RegionMatches.java line 41:
> 39:
> 40: private final byte[] b1_UTF16 = new byte[]{0x04, 0x3d, 0x04, 0x30, 0x04, 0x36, 0x04, 0x34};
> 41: private final byte[] b2_UTF16 = new byte[]{0x04, 0x32, 0x00, 0x20, 0x04, 0x41, 0x04, 0x42};
For strings, the \uxxxx version would be preferred; it is clearer that what the character is and there is less of a chance that the UTF encoding has a mistake.
-------------
PR Review: https://git.openjdk.org/jdk/pull/15906#pullrequestreview-1646531054
PR Review Comment: https://git.openjdk.org/jdk/pull/15906#discussion_r1338610081
More information about the core-libs-dev
mailing list