Program: 94615
Project: 94615
Buggy source:
public Socket createSocket(String remoteHost,int remotePort,InetAddress clientHost,int clientPort,HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException {
  final SSLSocketFactory factory=getSSLSocketFactory();
  if (factory == null)   throw new IOException("String_Node_Str");
  if (params == null || params.getConnectionTimeout() == 0)   return factory.createSocket(remoteHost,remotePort,clientHost,clientPort);
  if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) {
    final ProxyClient proxyClient=new ProxyClient();
    final ProxyAddress address=proxy.getAddress();
    proxyClient.getHostConfiguration().setProxy(address.getHostName(),address.getPort());
    proxyClient.getHostConfiguration().setHost(remoteHost,remotePort);
    final String proxyUsername=proxy.getUsername();
    final String proxyPassword=proxy.getPassword();
    if (proxyUsername != null && !proxyUsername.equals("String_Node_Str")) {
      final Credentials credentials=new UsernamePasswordCredentials(proxyUsername,proxyPassword);
      final AuthScope proxyAuthScope=new AuthScope(address.getHostName(),address.getPort(),AuthScope.ANY_REALM);
      proxyClient.getState().setProxyCredentials(proxyAuthScope,credentials);
    }
    final ProxyClient.ConnectResponse response=proxyClient.connect();
    if (response.getSocket() != null) {
      final Socket sslsocket=factory.createSocket(response.getSocket(),remoteHost,remotePort,true);
      return sslsocket;
    }
  }
  final Socket socket=factory.createSocket();
  socket.bind(new InetSocketAddress(clientHost,clientPort));
  socket.connect(new InetSocketAddress(remoteHost,remotePort),params.getConnectionTimeout());
  return socket;
}

Fixed version (ground truth):
public Socket createSocket(String remoteHost,int remotePort,InetAddress clientHost,int clientPort,HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException {
  final SSLSocketFactory factory=Activator.getDefault().getSSLSocketFactory();
  if (factory == null)   throw new IOException("String_Node_Str");
  if (params == null || params.getConnectionTimeout() == 0)   return factory.createSocket(remoteHost,remotePort,clientHost,clientPort);
  if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) {
    final ProxyClient proxyClient=new ProxyClient();
    final ProxyAddress address=proxy.getAddress();
    proxyClient.getHostConfiguration().setProxy(address.getHostName(),address.getPort());
    proxyClient.getHostConfiguration().setHost(remoteHost,remotePort);
    final String proxyUsername=proxy.getUsername();
    final String proxyPassword=proxy.getPassword();
    if (proxyUsername != null && !proxyUsername.equals("String_Node_Str")) {
      final Credentials credentials=new UsernamePasswordCredentials(proxyUsername,proxyPassword);
      final AuthScope proxyAuthScope=new AuthScope(address.getHostName(),address.getPort(),AuthScope.ANY_REALM);
      proxyClient.getState().setProxyCredentials(proxyAuthScope,credentials);
    }
    final ProxyClient.ConnectResponse response=proxyClient.connect();
    if (response.getSocket() != null) {
      final Socket sslsocket=factory.createSocket(response.getSocket(),remoteHost,remotePort,true);
      return sslsocket;
    }
  }
  final Socket socket=factory.createSocket(remoteHost,remotePort,clientHost,clientPort);
  return socket;
}