RFR: 8372787: ModuleReader should throw IOException consistently when using --patch-module and ModuleReader is closed [v6]

Alan Bateman alanb at openjdk.org
Mon Dec 1 17:29:24 UTC 2025


On Mon, 1 Dec 2025 17:11:18 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> Does this behavior change merit CSR review?

The behavior change is hard to observe. You'd need use `--patch-module` to patch a module on the module path, create a ModuleReader to find/read resources from the patched module, and then attempt to do so after closing the reader. The expected IOException is not thrown, instead you will an unexpected IllegalStateException in the case of JAR files, or the success in the case of an exploded patch. I can't imagine anything depending on this behavor. It came up in the context of the Valhalla repo which has some temporary code that seem to be incorrectly closing a module reader.

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

PR Comment: https://git.openjdk.org/jdk/pull/28569#issuecomment-3597882266


More information about the core-libs-dev mailing list