8166059: JSR166TestCase.java fails with NPE in dumpTestThreads on timeout
Reviewed-by: martin, chegar, shade
This commit is contained in:
parent
c9f268cc15
commit
edc7565f51
@ -1032,14 +1032,17 @@ public class JSR166TestCase extends TestCase {
|
|||||||
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
|
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
|
||||||
System.err.println("------ stacktrace dump start ------");
|
System.err.println("------ stacktrace dump start ------");
|
||||||
for (ThreadInfo info : threadMXBean.dumpAllThreads(true, true)) {
|
for (ThreadInfo info : threadMXBean.dumpAllThreads(true, true)) {
|
||||||
String name = info.getThreadName();
|
final String name = info.getThreadName();
|
||||||
|
String lockName;
|
||||||
if ("Signal Dispatcher".equals(name))
|
if ("Signal Dispatcher".equals(name))
|
||||||
continue;
|
continue;
|
||||||
if ("Reference Handler".equals(name)
|
if ("Reference Handler".equals(name)
|
||||||
&& info.getLockName().startsWith("java.lang.ref.Reference$Lock"))
|
&& (lockName = info.getLockName()) != null
|
||||||
|
&& lockName.startsWith("java.lang.ref.Reference$Lock"))
|
||||||
continue;
|
continue;
|
||||||
if ("Finalizer".equals(name)
|
if ("Finalizer".equals(name)
|
||||||
&& info.getLockName().startsWith("java.lang.ref.ReferenceQueue$Lock"))
|
&& (lockName = info.getLockName()) != null
|
||||||
|
&& lockName.startsWith("java.lang.ref.ReferenceQueue$Lock"))
|
||||||
continue;
|
continue;
|
||||||
if ("checkForWedgedTest".equals(name))
|
if ("checkForWedgedTest".equals(name))
|
||||||
continue;
|
continue;
|
||||||
@ -1783,7 +1786,7 @@ public class JSR166TestCase extends TestCase {
|
|||||||
* A CyclicBarrier that uses timed await and fails with
|
* A CyclicBarrier that uses timed await and fails with
|
||||||
* AssertionFailedErrors instead of throwing checked exceptions.
|
* AssertionFailedErrors instead of throwing checked exceptions.
|
||||||
*/
|
*/
|
||||||
public class CheckedBarrier extends CyclicBarrier {
|
public static class CheckedBarrier extends CyclicBarrier {
|
||||||
public CheckedBarrier(int parties) { super(parties); }
|
public CheckedBarrier(int parties) { super(parties); }
|
||||||
|
|
||||||
public int await() {
|
public int await() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user