Removed unnecessary socket class check
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@722283 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
59b1f4047d
commit
a412fd3bc8
|
@ -140,13 +140,6 @@ public final class PlainSocketFactory implements SocketFactory {
|
|||
if (sock == null) {
|
||||
throw new IllegalArgumentException("Socket may not be null.");
|
||||
}
|
||||
// This class check assumes that createSocket() calls the constructor
|
||||
// directly. If it was using javax.net.SocketFactory, we couldn't make
|
||||
// an assumption about the socket class here.
|
||||
if (sock.getClass() != Socket.class) {
|
||||
throw new IllegalArgumentException
|
||||
("Socket not created by this factory.");
|
||||
}
|
||||
// This check is performed last since it calls a method implemented
|
||||
// by the argument object. getClass() is final in java.lang.Object.
|
||||
if (sock.isClosed()) {
|
||||
|
|
Loading…
Reference in New Issue