From d8b5f0e1b3f75004c46e2b6166cc96954601a2d7 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 15 Feb 2019 18:31:53 +1100 Subject: [PATCH] Issue #3341 - HttpClientProvider changes from review Signed-off-by: Lachlan Roberts --- .../jetty/websocket/core/client/HttpClientProvider.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java index 4f3a11bd2b9..a9f7e965404 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java @@ -39,10 +39,10 @@ public interface HttpClientProvider Log.getLogger(HttpClientProvider.class).ignore(ignore); } - return new HttpClientProvider(){}.newHttpClient(); + return HttpClientProvider.newDefaultHttpClient(); } - default HttpClient newHttpClient() + private static HttpClient newDefaultHttpClient() { HttpClient client = new HttpClient(new SslContextFactory()); QueuedThreadPool threadPool = new QueuedThreadPool(); @@ -50,4 +50,9 @@ public interface HttpClientProvider client.setExecutor(threadPool); return client; } + + default HttpClient newHttpClient() + { + return newDefaultHttpClient(); + } }