--- jsr166/src/test/tck/JSR166TestCase.java 2019/08/20 23:06:11 1.258 +++ jsr166/src/test/tck/JSR166TestCase.java 2019/09/05 17:27:07 1.260 @@ -754,8 +754,8 @@ public class JSR166TestCase extends Test */ public void threadRecordFailure(Throwable t) { System.err.println(t); - dumpTestThreads(); - threadFailure.compareAndSet(null, t); + if (threadFailure.compareAndSet(null, t)) + dumpTestThreads(); } public void setUp() { @@ -1456,11 +1456,11 @@ public class JSR166TestCase extends Test } catch (InterruptedException fail) { threadUnexpectedException(fail); } - Thread.State state; - if ((state = t.getState()) != Thread.State.TERMINATED) { - t.interrupt(); - threadFail("timed out waiting for thread to terminate; " - + "state=" + state); + Thread.State state; + if ((state = t.getState()) != Thread.State.TERMINATED) { + t.interrupt(); + threadFail("timed out waiting for thread to terminate; " + + "state=" + state); } }