From d717be14502554ceb31dadac9aab53973c619b08 Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Fri, 16 Mar 2012 14:52:49 -0500 Subject: [PATCH] [Bug 374367] NPE in QueuedThreadPool.dump() with early java6 jvms --- .../eclipse/jetty/util/thread/QueuedThreadPool.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index e3cccc09dd8..a6ae12096f1 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -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;