On Mon, 20 Apr 2026 08:40:53 GMT, Severin Gehwolf <[email protected]> wrote:

> Shouldn't ModuleReader.open("META-INF/preview/java/lang/Byte.class") then 
> also not return the input stream to the preview classes?

META-INF/preview won't be used until JEP 401 integrates.

The important usage at runtime is `open("java/lang/Byte.class")`,  which we 
would see with code like `Byte.class.getResourceAsStream("Byte.class")`.  If 
there is version of the class file in META-INF/preview then it will locate that 
when preview features are enabled.

`open("META-INF/preview/java/lang/Byte.class")` would be unusual but it will 
(at least in the lword) branch, locate the class bytes for the version of 
j.l.Byte compiled with preview features enabled. I'm not sure if you are 
suggesting this should also be hidden but do need to have a story on the 
consistently when the full list of resources are enumerated with 
`ModuleReader::list`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29414#discussion_r3109596382

Reply via email to