Source:
<code>public HttpClientConnection create(final HttpHost host) throws IOException { final String scheme = host.getSchemeName(); final Socket socket; if ("http".equalsIgnoreCase(scheme)) { socket = this.plainfactory != null ? this.plainfactory.createSocket() : new Socket(); } else if ("https".equalsIgnoreCase(scheme)) { socket = (this.sslfactory != null ? this.sslfactory : SSLSocketFactory.getDefault()).createSocket(); } else { throw new IOException(scheme + " scheme is not supported"); } final String hostname = host.getHostName(); int port = host.getPort(); if (port == -1) { if (host.getSchemeName().equalsIgnoreCase("http")) { port = 80; } else if (host.getSchemeName().equalsIgnoreCase("https")) { port = 443; } } socket.setSoTimeout(this.sconfig.getSoTimeout()); if (this.sconfig.getSndBufSize() > 0) { socket.setSendBufferSize(this.sconfig.getSndBufSize()); } if (this.sconfig.getRcvBufSize() > 0) { socket.setReceiveBufferSize(this.sconfig.getRcvBufSize()); } socket.setTcpNoDelay(this.sconfig.isTcpNoDelay()); final int linger = this.sconfig.getSoLinger(); if (linger >= 0) { socket.setSoLinger(true, linger); } socket.setKeepAlive(this.sconfig.isSoKeepAlive()); <START> final Socket finalSocket = socket; <END> final InetSocketAddress address = new InetSocketAddress(hostname, port); try { AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { @Override public Object run() throws IOException { finalSocket.connect(address, BasicConnFactory.this.connectTimeout); return null; } }); } catch (final PrivilegedActionException e) { Asserts.check(e.getCause() instanceof IOException, "method contract violation only checked exceptions are wrapped: " + e.getCause()); throw (IOException) e.getCause(); } return this.connFactory.createConnection(socket); }</code><technical_language>@s1monw eliminate finalSocket? is longer required</technical_language>

Target:
public HttpClientConnection create(final HttpHost host) throws IOException { final String scheme = host.getSchemeName(); final Socket socket; if ("http".equalsIgnoreCase(scheme)) { socket = this.plainfactory != null ? this.plainfactory.createSocket() : new Socket(); } else if ("https".equalsIgnoreCase(scheme)) { socket = (this.sslfactory != null ? this.sslfactory : SSLSocketFactory.getDefault()).createSocket(); } else { throw new IOException(scheme + " scheme is not supported"); } final String hostname = host.getHostName(); int port = host.getPort(); if (port == -1) { if (host.getSchemeName().equalsIgnoreCase("http")) { port = 80; } else if (host.getSchemeName().equalsIgnoreCase("https")) { port = 443; } } socket.setSoTimeout(this.sconfig.getSoTimeout()); if (this.sconfig.getSndBufSize() > 0) { socket.setSendBufferSize(this.sconfig.getSndBufSize()); } if (this.sconfig.getRcvBufSize() > 0) { socket.setReceiveBufferSize(this.sconfig.getRcvBufSize()); } socket.setTcpNoDelay(this.sconfig.isTcpNoDelay()); final int linger = this.sconfig.getSoLinger(); if (linger >= 0) { socket.setSoLinger(true, linger); } socket.setKeepAlive(this.sconfig.isSoKeepAlive()); final InetSocketAddress address = new InetSocketAddress(hostname, port); try { AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { @Override public Object run() throws IOException { socket.connect(address, BasicConnFactory.this.connectTimeout); return null; } }); } catch (final PrivilegedActionException e) { Asserts.check(e.getCause() instanceof IOException, "method contract violation only checked exceptions are wrapped: " + e.getCause()); throw (IOException) e.getCause(); } return this.connFactory.createConnection(socket); }