RFR: 8356645: Javac should utilize new ZIP file system read-only access mode

Jan Lahoda jlahoda at openjdk.org
Wed Jun 11 06:04:33 UTC 2025


On Tue, 10 Jun 2025 13:49:29 GMT, Chen Liang <liach at openjdk.org> wrote:

>> It's possible. I remember having to change this when I prototyped the new code a while ago, but I'm not sure I remember exactly why. I can try reverting it if the original style is acceptable (personally I prefer to compile on-the-fly since it can test the compiler with different options - which is probably why I changed it originally).
>
> Also for compile on-the-fly, I usually use `InMemoryJavaCompiler` and `ByteCodeLoader` available with `/test/lib` library. `InMemoryJavaCompiler` conveniently returns a list of all class files, and its one-class-file version throws an exception if a compilation unit generates more than one class, which is not usually checked by manual invocations to javac task.

For new tests, I would often prefer to use on-the-fly compilation (although javac has its own frameworks to do that, like the `ToolBox` used here).

For existing tests, I generally prefer to restrict changes to a minimum (although opinions may differ on that).

But here, I wonder: why is the test failing? I didn't see anything in the patch that would seem to be an obvious cause of a breakage of a test like this. So, I think it deserves a good look to find out what's the cause of the test failing, rather than just adjusting the test to pass.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25639#discussion_r2139275769


More information about the compiler-dev mailing list