RFR: 8295176: some langtools test pollutes source tree

Srikanth Adayapalam sadayapalam at openjdk.org
Mon Oct 17 10:14:12 UTC 2022


On Mon, 17 Oct 2022 09:35:40 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> The `ReleaseOptionThroughAPI.java` test compiles another test source, `ReleaseOption.java`. But it does not specify the output directory, so javac generates the classfile next to the source files into the source directory, causing trouble.
> 
> The proposed fix is to add `-d .` to the test, so that the classfile is not generated into the working directory.

Thanks so much for fixing this. It was beginning to irritate me.

The fix is ok, but doing a bit of archaeology, it looks like the fix for JDK-8173605 introduced the problem. JDK-8173605 attempts to remove support for source and target 1.7 option in javac. In so doing, the test ReleaseOption.java
whose objective is to "Verify that javac rejects Java 8 program with --release 7" becomes irrelevant and perhaps the whole test could have been deleted rather than making the negative test (that would fail to compile) into a positive test that compiles fine.

In particular the Summary line in ReleaseOption.java is stale.

It is not clear to me that the test serves any real purpose - compiled directly or through the API.

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

PR: https://git.openjdk.org/jdk/pull/10724


More information about the compiler-dev mailing list