diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java index 798434a74a7..1a81f776131 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java @@ -32,7 +32,6 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.util.thread.QueuedThreadPool; /** * A Jetty server with multiple connectors. diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java index 3deae692ce1..023da71bfd9 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java @@ -73,7 +73,6 @@ import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; -import org.eclipse.jetty.util.thread.ThreadBudget; import org.eclipse.jetty.util.thread.ThreadPool; /** diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java index 467920df9bf..792610ea6b6 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java @@ -70,7 +70,6 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump int cpus = Runtime.getRuntime().availableProcessors(); return Math.max(1,Math.min(cpus/2,threads/16)); } - return Math.max(1,Runtime.getRuntime().availableProcessors()/2); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java index f476b58b9fd..d3807cfa175 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java @@ -24,7 +24,6 @@ import java.net.InetSocketAddress; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.Enumeration; @@ -66,9 +65,7 @@ import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Locker; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ShutdownThread; -import org.eclipse.jetty.util.thread.ThreadBudget; import org.eclipse.jetty.util.thread.ThreadPool; -import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool; /* ------------------------------------------------------------ */ /** Jetty HTTP Servlet Server. diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/InsufficientThreadsDetectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/InsufficientThreadsDetectionTest.java index c4e53c9bdf3..adce494570b 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/InsufficientThreadsDetectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/InsufficientThreadsDetectionTest.java @@ -82,8 +82,6 @@ public class InsufficientThreadsDetectionTest _server.start(); } - // Github issue #586 - @Test public void testCaseForMultipleConnectors() throws Exception { @@ -95,14 +93,14 @@ public class InsufficientThreadsDetectionTest // first connector consumes 3 threads from server pool _server.addConnector(new ServerConnector(_server, null, null, null, 1, 1, new HttpConnectionFactory())); - // second connect also require 4 threads but uses own executor, so its threads should not be counted + // second connect also require 3 threads but uses own executor, so its threads should not be counted final QueuedThreadPool connectorPool = new QueuedThreadPool(4, 4); _server.addConnector(new ServerConnector(_server, connectorPool, null, null, 1, 1, new HttpConnectionFactory())); - // first connector consumes 3 threads from server pool + // third connector consumes 3 threads from server pool _server.addConnector(new ServerConnector(_server, null, null, null, 1, 1, new HttpConnectionFactory())); - // should not throw exception because limit was not overflown + // should throw exception because limit was overflown _server.start(); Assert.fail(); @@ -112,5 +110,4 @@ public class InsufficientThreadsDetectionTest Log.getLogger(ThreadBudget.class).warn(e.toString()); } } - } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java index 1776d743188..f7fde9964dd 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java @@ -18,11 +18,7 @@ package org.eclipse.jetty.util.component; -import java.util.ArrayList; import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - /** * A Container