RFR: 8341778: Some javac tests ignore the result of JavacTask::call

Aleksey Shipilev shade at openjdk.org
Thu Jun 5 06:20:52 UTC 2025


On Wed, 4 Jun 2025 21:02:04 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Several tests are ignoring the result of invoking com.sun.source.util.JavacTask::call which returns a `Boolean`. This implies that tests could seem to pass when in reality they are silently failing. This PR is fixing this issue by checking, in all applicable cases the result of the invocation.
> 
> TIA

Looks good, but I have question about hunks that are not about wrapping `call()`-s. Those look like fixing the actual test bugs?

test/langtools/tools/javac/T6361619.java line 53:

> 51:         final PrintWriter out = new PrintWriter(System.err, true);
> 52: 
> 53:         Iterable<String> flags = Arrays.asList("--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",

Why `--add-exports`? Did this test actually failed without us noticing?

test/langtools/tools/javac/api/8007344/Test.java line 79:

> 77:     }
> 78: 
> 79:     static final List<String> OPTIONS = List.of(

Same question here...

test/langtools/tools/javac/patterns/SOEDeeplyNestedBlocksTest.java line 37:

> 35: public class SOEDeeplyNestedBlocksTest {
> 36: 
> 37:     static final int NESTING_DEPTH = 500;

Same question here.

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

PR Review: https://git.openjdk.org/jdk/pull/25645#pullrequestreview-2898988500
PR Review Comment: https://git.openjdk.org/jdk/pull/25645#discussion_r2128026868
PR Review Comment: https://git.openjdk.org/jdk/pull/25645#discussion_r2128036046
PR Review Comment: https://git.openjdk.org/jdk/pull/25645#discussion_r2128036600


More information about the hotspot-gc-dev mailing list