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

Chen Liang liach at openjdk.org
Tue Jun 10 13:52:27 UTC 2025


On Tue, 10 Jun 2025 13:33:28 GMT, David Beaumont <duke at openjdk.org> wrote:

>> The class file is from this test file instead of the test libraries, and this pattern of shipping additional classes in the same compilation unit for class file handling in tests is common in jdk/classfile and other packages. Could the `clean` directive be the culprit?
>
> 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.

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

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


More information about the compiler-dev mailing list