[Bug 374367] NPE in QueuedThreadPool.dump() with early java6 jvms

This commit is contained in:
Jesse McConnell 2012-03-16 14:52:49 -05:00
parent ec2ccec766
commit d717be1450
1 changed files with 8 additions and 4 deletions

View File

@ -465,12 +465,16 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo
{
final StackTraceElement[] trace=thread.getStackTrace();
boolean inIdleJobPoll=false;
for (StackTraceElement t : trace)
// trace can be null on early java 6 jvms
if (trace != null)
{
if ("idleJobPoll".equals(t.getMethodName()))
for (StackTraceElement t : trace)
{
inIdleJobPoll=true;
break;
if ("idleJobPoll".equals(t.getMethodName()))
{
inIdleJobPoll = true;
break;
}
}
}
final boolean idle=inIdleJobPoll;