From e4f655d70f38975823b60e4498c72dcf4188e28e Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Thu, 7 Aug 2025 19:13:38 +0200 Subject: [PATCH] Improving test debuggability. --- test/langtools/tools/javac/patterns/Exhaustiveness.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/langtools/tools/javac/patterns/Exhaustiveness.java b/test/langtools/tools/javac/patterns/Exhaustiveness.java index 53c4bf82317..a0236f323e2 100644 --- a/test/langtools/tools/javac/patterns/Exhaustiveness.java +++ b/test/langtools/tools/javac/patterns/Exhaustiveness.java @@ -1636,10 +1636,11 @@ public class Exhaustiveness extends TestRunner { @Test public void testDeeplyNestedNotExhaustive(Path base) throws Exception { List variants = createDeeplyNestedVariants().stream().collect(Collectors.toCollection(ArrayList::new)); - variants.remove((int) (Math.random() * variants.size())); + int removed = (int) (Math.random() * variants.size()); + variants.remove(removed); String code = testCodeForVariants(variants); - System.err.println("analyzing:"); + System.err.println("analyzing (removed: " + removed + "):"); System.err.println(code); doTest(base, new String[0],