Program: 41329
Project: 41329
Buggy source:
private synchronized Token refreshToken(String serviceAddress,String caCertData,boolean skipTlsVerify) throws IOException {
  URI uri=null;
  try {
    uri=new URI(serviceAddress);
  }
 catch (  URISyntaxException e) {
    throw new IOException("String_Node_Str" + serviceAddress,e);
  }
  final HttpClientBuilder builder=HttpClients.custom().setRedirectStrategy(NO_REDIRECT);
  if (skipTlsVerify || caCertData != null) {
    final SSLContextBuilder sslBuilder=new SSLContextBuilder();
    HostnameVerifier hostnameVerifier=SSLConnectionSocketFactory.getDefaultHostnameVerifier();
    try {
      if (skipTlsVerify) {
        sslBuilder.loadTrustMaterial(null,ALWAYS);
        hostnameVerifier=NoopHostnameVerifier.INSTANCE;
      }
 else       if (caCertData != null) {
        KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
        ks.load(null);
        CertificateFactory f=CertificateFactory.getInstance("String_Node_Str");
        X509Certificate cert=(X509Certificate)f.generateCertificate(new Base64InputStream(new ByteArrayInputStream(caCertData.getBytes())));
        ks.setCertificateEntry(uri.getHost(),cert);
        sslBuilder.loadTrustMaterial(ks,null);
      }
      builder.setSSLSocketFactory(new SSLConnectionSocketFactory(sslBuilder.build(),hostnameVerifier));
    }
 catch (    NoSuchAlgorithmException e) {
      e.printStackTrace();
    }
catch (    KeyManagementException e) {
      e.printStackTrace();
    }
catch (    KeyStoreException e) {
      e.printStackTrace();
    }
catch (    CertificateException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  HttpGet authorize=new HttpGet(serviceAddress + "String_Node_Str");
  authorize.setHeader("String_Node_Str","String_Node_Str" + Base64.encodeBase64String((getUsername() + ':' + Secret.toString(getPassword())).getBytes()));
  final CloseableHttpResponse response=builder.build().execute(authorize);
  if (response.getStatusLine().getStatusCode() != 302) {
    throw new IOException("String_Node_Str" + response.getStatusLine().getStatusCode());
  }
  String location=response.getFirstHeader("String_Node_Str").getValue();
  String parameters=location.substring(location.indexOf('#') + 1);
  List<NameValuePair> pairs=URLEncodedUtils.parse(parameters,Charset.forName("String_Node_Str"));
  Token t=new Token();
  for (  NameValuePair pair : pairs) {
    if (pair.getName().equals("String_Node_Str")) {
      t.value=pair.getValue();
    }
 else     if (pair.getName().equals("String_Node_Str")) {
      t.expire=System.currentTimeMillis() + Long.parseLong(pair.getValue()) * 1000 - 100;
    }
  }
  return t;
}

Fixed version (ground truth):
private synchronized Token refreshToken(String serviceAddress,String caCertData,boolean skipTlsVerify) throws IOException {
  URI uri=null;
  try {
    uri=new URI(serviceAddress);
  }
 catch (  URISyntaxException e) {
    throw new IOException("String_Node_Str" + serviceAddress,e);
  }
  final HttpClientBuilder builder=HttpClients.custom().setRedirectStrategy(NO_REDIRECT);
  if (skipTlsVerify || caCertData != null) {
    final SSLContextBuilder sslBuilder=new SSLContextBuilder();
    HostnameVerifier hostnameVerifier=SSLConnectionSocketFactory.getDefaultHostnameVerifier();
    try {
      if (skipTlsVerify) {
        sslBuilder.loadTrustMaterial(null,ALWAYS);
        hostnameVerifier=NoopHostnameVerifier.INSTANCE;
      }
 else       if (caCertData != null) {
        KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
        ks.load(null);
        CertificateFactory f=CertificateFactory.getInstance("String_Node_Str");
        X509Certificate cert=(X509Certificate)f.generateCertificate(new Base64InputStream(new ByteArrayInputStream(caCertData.getBytes(StandardCharsets.UTF_8))));
        ks.setCertificateEntry(uri.getHost(),cert);
        sslBuilder.loadTrustMaterial(ks,null);
      }
      builder.setSSLSocketFactory(new SSLConnectionSocketFactory(sslBuilder.build(),hostnameVerifier));
    }
 catch (    NoSuchAlgorithmException e) {
      e.printStackTrace();
    }
catch (    KeyManagementException e) {
      e.printStackTrace();
    }
catch (    KeyStoreException e) {
      e.printStackTrace();
    }
catch (    CertificateException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  HttpGet authorize=new HttpGet(serviceAddress + "String_Node_Str");
  authorize.setHeader("String_Node_Str","String_Node_Str" + Base64.encodeBase64String((getUsername() + ':' + Secret.toString(getPassword())).getBytes(StandardCharsets.UTF_8)));
  final CloseableHttpResponse response=builder.build().execute(authorize);
  if (response.getStatusLine().getStatusCode() != 302) {
    throw new IOException("String_Node_Str" + response.getStatusLine().getStatusCode());
  }
  String location=response.getFirstHeader("String_Node_Str").getValue();
  String parameters=location.substring(location.indexOf('#') + 1);
  List<NameValuePair> pairs=URLEncodedUtils.parse(parameters,StandardCharsets.UTF_8);
  Token t=new Token();
  for (  NameValuePair pair : pairs) {
    if (pair.getName().equals("String_Node_Str")) {
      t.value=pair.getValue();
    }
 else     if (pair.getName().equals("String_Node_Str")) {
      t.expire=System.currentTimeMillis() + Long.parseLong(pair.getValue()) * 1000 - 100;
    }
  }
  return t;
}