On 8/27/2026 3:30 AM, Alan Bateman wrote:
On 27/08/2026 11:00, Rafael Winterhalter wrote:>> If I now inspect the compiled 
module-info.class, the 2.33 version is
missing:
javap -v out/module-info.class | sed -n '/^Module:/,/exports/p'
Running the app using java does however surface the module:
java --module-path .:out -m demo.app/demo.Main Where 2.33 is visible in the stack trace. I would have expected that javac considers the version of the automatic module the same way as java does, but I am wondering if this is intended or an oversight.
>
Okay, so the question is about the requires table in the Module attribute. Each entry specifies a dependency and it can optionally record (for information purposes) the version of the dependence. I can't find any notes to explain why it is recorded for explicit modules and not for automatic modules, maybe Alex or others can find something.

An automatic module can have a version, per the spec of `ModuleFinder.of` and the design discussions that led to that spec, so I think it's an oversight that javac doesn't record an automatic module's version in Module.requires[].requires_version_index.

Rafael, please file a tools/javac bug.

Alex

Reply via email to