RFR: 8322018: Test java/lang/String/CompactString/MaxSizeUTF16String.java fails with -Xcomp

Roger Riggs rriggs at openjdk.org
Wed Dec 13 21:44:47 UTC 2023


The test java/lang/String/CompactString/MaxSizeUTF16String.java fails when run with -Xcomp.

Both the java implementation and the intrinsic for StringUTF16.toBytes() allocate memory for a copy of the string.
The java implementation of `toBytes()` throws an exception with a message in terms of length of the string.
The intrinsic uses a generic message when allocating a byte array that is too large for the implementation.

Test should accept either message on the OOME exception, the message is an implementation detail and should reflect the cause of the error and not be confused with a general out of java heap message.

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

Commit messages:
 - Handle the case of insufficient heap distinctly from the wrong message
 - 8322018: Test java/lang/String/CompactString/MaxSizeUTF16String.java fails with -Xcomp

Changes: https://git.openjdk.org/jdk/pull/17095/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17095&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8322018
  Stats: 19 lines in 1 file changed: 14 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/17095.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17095/head:pull/17095

PR: https://git.openjdk.org/jdk/pull/17095


More information about the core-libs-dev mailing list