Sineaggi commented on code in PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#discussion_r1453711034


##########
httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java:
##########
@@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() {
 
     @Override
     public Socket createSocket(final Proxy proxy, final HttpContext context) 
throws IOException {
-        return proxy != null ? new Socket(proxy) : new Socket();

Review Comment:
   > The check for the proxy being non null should be performed by the method.
   
   There are two overloads of the method `createSocket` in the interface, one 
that takes a Proxy, the other one doesn't. I don't think it's obvious at first 
glance that the check for the proxy being non null should ever have to be 
performed by this method. The documentation for the method even says 
   ```
   via a proxy (generally SOCKS is expected)
   ```
   which would imply that method is called via a proxy.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to