RFR: 8339384: Unintentional IOException in jdk.jdi module when JDWP end of stream occurs
Chris Plummer
cjplummer at openjdk.org
Tue Sep 3 20:50:23 UTC 2024
On Mon, 2 Sep 2024 12:24:28 GMT, Yagmur Eren <duke at openjdk.org> wrote:
> A logic error in the block of code in com.sun.tools.jdi.TargetVM is fixed by putting fromByteArray() method within else statement to prevent invoking it when the array b is empty. See issue: [JDK-8339384](https://bugs.openjdk.org/browse/JDK-8339384)
src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java line 127:
> 125: done = true;
> 126: } else {
> 127: p = Packet.fromByteArray(b);
Just to clarify, the IOException here is not actually causing any problems. It is caught immediately below, and we've already set done = true, so we still end up shutting down the connection. Is that correct? I'm okay with the change since it is a bit cleaner.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20815#discussion_r1742673324
More information about the serviceability-dev
mailing list