[crac] RFR: 8348869: [CRaC] Restore args are split by whitespaces incorrectly [v2]

Radim Vansa rvansa at openjdk.org
Thu Jan 30 14:59:25 UTC 2025


On Wed, 29 Jan 2025 15:54:34 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:

>> Fixes the issue by creating a new property `sun.java.crac_command` with spaces escaped. On restore, JVM parses this string de-escaping symbols.
>> 
>> Replaces abandoned #101.
>
> Timofei Pushkin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use StringBuffer to parse new restore args

src/java.base/share/classes/jdk/internal/crac/mirror/Core.java line 252:

> 250:                         curArgBuilder.setLength(0);
> 251:                     }
> 252:                     case escChar -> curArgBuilder.append(newArguments.charAt(++i));

This version looks much better, but I wonder what happens here if the escape is the last char - this code looks like it would throw OOBE (as there's no check after incrementation). It seems that situation is covered in the test case as well - I don't understand why it won't fail.

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

PR Review Comment: https://git.openjdk.org/crac/pull/193#discussion_r1935745427


More information about the crac-dev mailing list