8157528: jdk/jshell/ExecutionControlTest.java failed intermittently with NPE

Reviewed-by: jlahoda
This commit is contained in:
Robert Field 2016-05-23 13:05:04 -07:00
parent 5d1f9c9918
commit 7bcc48f00e

View File

@ -171,7 +171,8 @@ class LocalExecutionControl implements ExecutionControl {
Thread[] threadList = new Thread[execThreadGroup.activeCount()]; Thread[] threadList = new Thread[execThreadGroup.activeCount()];
execThreadGroup.enumerate(threadList); execThreadGroup.enumerate(threadList);
for (Thread thread : threadList) { for (Thread thread : threadList) {
thread.join(); if (thread != null)
thread.join();
} }
if (stopped.get()) { if (stopped.get()) {