On Wed, 12 Feb 2025 15:39:11 GMT, Chen Liang <li...@openjdk.org> wrote:
>> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Lance's suggestion > > src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ZipPlugin.java > line 99: > >> 97: stream.close(); >> 98: } catch (IOException ex) { >> 99: return bytesIn; // return the original uncompressed input > > This really won't happen. The close for byte array in/out streams are no-op > and can be omitted. I believe putting an assertion here is better too. > > And by practice, calling methods on an in/out stream after close doesn't make > much sense too. Here we are calling `toByteArray` after close, which looks > weird. Hello Chen, after Lance suggested a similar change, I've updated the PR and with that update this `stream.close()` is no longer explicitly done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23588#discussion_r1952909253