implementing abstract methods to avoid false negatives due to dynamic dispatch issues

Reviewed By: jeremydubreil

Differential Revision: D2680252

fb-gh-sync-id: bc87bb3
master
Sam Blackshear 9 years ago committed by facebook-github-bot-5
parent 29ea879930
commit 867e7804af

@ -9,6 +9,8 @@
package javax.net; package javax.net;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;
import com.facebook.infer.models.InferBuiltins; import com.facebook.infer.models.InferBuiltins;
@ -38,4 +40,25 @@ public class SocketFactory {
return socket; return socket;
} }
// the methods below are abstract methods in the actual Java class, but we need to implement it
// explicitly due to Infer's dynamic dispatch woes
public Socket createSocket(InetAddress addr, int i) throws IOException {
return this.createSocket();
}
public Socket createSocket(InetAddress addr1, int i, InetAddress addr2, int j)
throws IOException {
return this.createSocket();
}
public Socket createSocket(String s, int i) throws IOException {
return this.createSocket();
}
public Socket createSocket(String s, int i, InetAddress addr, int j) throws IOException {
return this.createSocket();
}
} }

@ -23,16 +23,25 @@ public class SSLSocketFactory extends SocketFactory {
return super.createSocket(); return super.createSocket();
} }
@Override
public Socket createSocket(InetAddress addr1, int i, InetAddress addr2, int j) throws IOException { public Socket createSocket(InetAddress addr1, int i, InetAddress addr2, int j) throws IOException {
return super.createSocket(); return super.createSocket();
} }
@Override
public Socket createSocket(String s, int i) throws IOException { public Socket createSocket(String s, int i) throws IOException {
return super.createSocket(); return super.createSocket();
} }
@Override
public Socket createSocket(String s, int i, InetAddress addr, int j) throws IOException { public Socket createSocket(String s, int i, InetAddress addr, int j) throws IOException {
return super.createSocket(); return super.createSocket();
} }
// the method below is an abstract method in the actual Java class, but we need to implement it
// explicitly due to Infer's dynamic dispatch woes
public Socket createSocket(Socket s, String host, int i, boolean b) throws IOException {
return super.createSocket();
}
} }

Loading…
Cancel
Save