[crac] RFR: 8368570: [CRaC] Improve JdwpTransportTest [v3]

Timofei Pushkin tpushkin at openjdk.org
Mon Sep 29 12:13:04 UTC 2025


On Mon, 29 Sep 2025 12:03:16 GMT, Roman Marchenko <rmarchenko at openjdk.org> wrote:

>> 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.

Oh, yes, then there should be either another wrapping try-with-resources or explicit `close` calls in the existing `finally`

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

PR Review Comment: https://git.openjdk.org/crac/pull/265#discussion_r2387703725


More information about the crac-dev mailing list