Program: 10794
Project: 10794
Buggy source:
public void waitForHostIsReachable(URL url,int timeout){
  log.debug("String_Node_Str",url);
  long timeoutMillis=TimeUnit.MILLISECONDS.convert(timeout,TimeUnit.SECONDS);
  long endTimeMillis=System.currentTimeMillis() + timeoutMillis;
  try {
    TrustManager[] trustAllCerts=new TrustManager[]{new X509TrustManager(){
      public java.security.cert.X509Certificate[] getAcceptedIssuers(){
        return null;
      }
      public void checkClientTrusted(      X509Certificate[] certs,      String authType){
      }
      public void checkServerTrusted(      X509Certificate[] certs,      String authType){
      }
    }
};
    SSLContext sc=SSLContext.getInstance("String_Node_Str");
    sc.init(null,trustAllCerts,new java.security.SecureRandom());
    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
    HostnameVerifier allHostsValid=new HostnameVerifier(){
      public boolean verify(      String hostname,      SSLSession session){
        return true;
      }
    }
;
    HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
    HttpURLConnection connection=(HttpURLConnection)url.openConnection();
    connection.setConnectTimeout((int)timeoutMillis);
    connection.setReadTimeout((int)timeoutMillis);
    connection.setRequestMethod("String_Node_Str");
    int responseCode=0;
    while (true) {
      try {
        responseCode=connection.getResponseCode();
        break;
      }
 catch (      SSLHandshakeException ssl) {
        log.warn("String_Node_Str",ssl.getMessage());
        Thread.sleep(1000);
      }
      if (System.currentTimeMillis() > endTimeMillis) {
        break;
      }
    }
    if (responseCode != HttpURLConnection.HTTP_OK) {
      Assert.fail("String_Node_Str" + url + "String_Node_Str"+ responseCode);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + url + "String_Node_Str"+ timeout+ "String_Node_Str"+ e.getClass().getName()+ "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
  }
  log.debug("String_Node_Str",url);
}

Fixed version (ground truth):
public void waitForHostIsReachable(URL url,int timeout){
  log.debug("String_Node_Str",url);
  long timeoutMillis=TimeUnit.MILLISECONDS.convert(timeout,TimeUnit.SECONDS);
  long endTimeMillis=System.currentTimeMillis() + timeoutMillis;
  try {
    TrustManager[] trustAllCerts=new TrustManager[]{new X509TrustManager(){
      public java.security.cert.X509Certificate[] getAcceptedIssuers(){
        return null;
      }
      public void checkClientTrusted(      X509Certificate[] certs,      String authType){
      }
      public void checkServerTrusted(      X509Certificate[] certs,      String authType){
      }
    }
};
    SSLContext sc=SSLContext.getInstance("String_Node_Str");
    sc.init(null,trustAllCerts,new java.security.SecureRandom());
    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
    HostnameVerifier allHostsValid=new HostnameVerifier(){
      public boolean verify(      String hostname,      SSLSession session){
        return true;
      }
    }
;
    HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
    int responseCode=0;
    while (true) {
      try {
        HttpURLConnection connection=(HttpURLConnection)url.openConnection();
        connection.setConnectTimeout((int)timeoutMillis);
        connection.setReadTimeout((int)timeoutMillis);
        connection.setRequestMethod("String_Node_Str");
        responseCode=connection.getResponseCode();
        break;
      }
 catch (      SSLHandshakeException ssl) {
        log.warn("String_Node_Str",ssl.getMessage());
        Thread.sleep(1000);
      }
      if (System.currentTimeMillis() > endTimeMillis) {
        break;
      }
    }
    if (responseCode != HttpURLConnection.HTTP_OK) {
      Assert.fail("String_Node_Str" + url + "String_Node_Str"+ responseCode);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + url + "String_Node_Str"+ timeout+ "String_Node_Str"+ e.getClass().getName()+ "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
  }
  log.debug("String_Node_Str",url);
}