http-client-branch: (WebSocket) the builder is immutable now http-client-branch
authorprappo
Fri, 17 Nov 2017 14:04:38 +0300
branchhttp-client-branch
changeset 55826 66b5d6013d85
parent 55824 b922df193260
child 55827 282ec9039187
http-client-branch: (WebSocket) the builder is immutable now
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java	Fri Nov 17 13:55:41 2017 +0300
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java	Fri Nov 17 14:04:38 2017 +0300
@@ -160,8 +160,7 @@
     }
 
     static CompletableFuture<WebSocket> newInstanceAsync(BuilderImpl b) {
-        URI uri = b.getUri();
-        Proxy proxy = proxyFor(b.getProxySelector(), uri);
+        Proxy proxy = proxyFor(b.getProxySelector(), b.getUri());
         try {
             checkPermissions(b, proxy);
         } catch (Throwable throwable) {
@@ -169,7 +168,7 @@
         }
 
         Function<Result, WebSocket> newWebSocket = r -> {
-            WebSocketImpl ws = new WebSocketImpl(uri,
+            WebSocketImpl ws = new WebSocketImpl(b.getUri(),
                                                  r.subprotocol,
                                                  r.channel,
                                                  b.getListener());