RFR: 8338675: javac shouldn't silently change .jar files on the classpath
David Beaumont
duke at openjdk.org
Fri Feb 21 10:29:01 UTC 2025
On Fri, 21 Feb 2025 08:46:34 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> Modifying `JavacFileManager` to skip creating sibling output class files for source files found in JARs.
>>
>> This should match older (JDK 8) behavior whereby the JAR was not writable, and results in any newly generated class files being written to the current working directory (the output of class files into current directory isn't good, but it should match the old behavior).
>
> test/langtools/tools/javac/T8338675/NoOverwriteJarClassFilesByDefault.java line 130:
>
>> 128:
>> 129: // Before running the test itself, get the CRC of the class file in the JAR.
>> 130: long originalLibCrc = getLibCrc();
>
> I think I would suggest to compute some hash for the whole jar, not only for the classfile. There should be no changes to the jar at all.
Good point. Done.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23699#discussion_r1965240725
More information about the compiler-dev
mailing list