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