RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2]

Christian Stein cstein at openjdk.org
Thu Sep 4 06:03:45 UTC 2025


On Wed, 3 Sep 2025 14:26:10 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update copyright year
>
> test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java line 210:
> 
>> 208: }
>> 209: 
>> 210: class LocalTestInstanceFactory implements TestInstanceFactory {
> 
> Since we have this again, can we just make a no-arg-constructor calling test instance factory and leave it in like /test/lib?

We either help Jupiter to select the right constructor or rewrite the test class to have a single one.

An alternative implemented in a future Jupiter version could be to ignore `private` constructors. On the other hand, having the need and ability to create "detached" test instances, not managed by Jupiter, is very uncommon. As those detached instances won't take part in Jupiter's test instance lifecycle: https://docs.junit.org/current/user-guide/#writing-tests-test-instance-lifecycle

> test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 25:
> 
>> 23: 
>> 24: // this test has been disabled because of timeout issues.
>> 25: // see JDK-8006746
> 
> Should we convert this to a full jtreg header and use problem lists or `@ignore` directive instead?

I didn't find `JDK-8006746` nor `8006746` in no other file — that's why I decided to dispose (against the goal of this PR to not clean up...) that comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2320918103
PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2320921571


More information about the compiler-dev mailing list