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 a35adc3c41d..57f1986cc57 100755 --- 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 @@ -20,7 +20,6 @@ package org.eclipse.jetty.util.thread; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.BlockingQueue; @@ -625,11 +624,15 @@ public class QueuedThreadPool extends ContainerLifeCycle implements SizedThreadP } } - List jobs = Collections.emptyList(); if (isDetailedDump()) - jobs = new ArrayList<>(getQueue()); - - dumpBeans(out, indent, new DumpableCollection("threads",threads), new DumpableCollection("jobs", jobs)); + { + List jobs = new ArrayList<>(getQueue()); + dumpBeans(out, indent, new DumpableCollection("threads", threads), new DumpableCollection("jobs", jobs)); + } + else + { + dumpBeans(out, indent, new DumpableCollection("threads", threads)); + } } @Override