[crac] RFR: 8368570: [CRaC] Improve JdwpTransportTest [v2]
Roman Marchenko
rmarchenko at openjdk.org
Mon Sep 29 12:06:08 UTC 2025
On Mon, 29 Sep 2025 08:57:48 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> Roman Marchenko has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Update test/lib/jdk/test/lib/crac/CracProcess.java
>>
>> fix grammar
>>
>> Co-authored-by: Timofei Pushkin <pushkin.td at gmail.com>
>> - Update test/jdk/jdk/crac/jdwp/JdwpTransportTest.java
>>
>> fix copyright
>>
>> Co-authored-by: Timofei Pushkin <pushkin.td at gmail.com>
>
> test/jdk/jdk/crac/jdwp/JdwpTransportTest.java line 112:
>
>> 110: CracProcess process = builder.captureOutput(true).startCheckpoint();
>> 111: var errReader = new AsyncStreamReader(process.errOutput());
>> 112: var reader = new AsyncStreamReader(process.output());
>
> Not that it matters much in this test, but I believe `AsyncStreamReader` should be made `AutoCloseable` (on close, close the buffer, maybe also stop the reading thread) and these should be treated as resources in the try below
Autocloseable is ok for me, but these two cannot be used in catch and finally blocks in case they are resources.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/265#discussion_r2387693792
More information about the crac-dev
mailing list