Program: 126749
Project: 126749
Buggy source:
private static SSLContext getSSLContext(String userDir) throws Exception {
  if (sslcontext == null) {
    String keystorePath=System.getProperty(TAC_SSL_CLIENT_KEY);
    String trustStorePath=System.getProperty(TAC_SSL_CLIENT_TRUST_KEY);
    String keystorePass=System.getProperty(TAC_SSL_KEYSTORE_PASS);
    String truststorePass=System.getProperty(TAC_SSL_TRUSTSTORE_PASS);
    if (keystorePath == null) {
      File keystorePathFile=new File(userDir + TAC_SSL_KEYSTORE);
      if (keystorePathFile.exists()) {
        keystorePath=keystorePathFile.getAbsolutePath();
      }
    }
    if (trustStorePath == null) {
      File trustStorePathFile=new File(userDir + TAC_SSL_TRUSTSTORE);
      if (trustStorePathFile.exists()) {
        trustStorePath=trustStorePathFile.getAbsolutePath();
      }
    }
    if (keystorePass == null) {
      keystorePass="String_Node_Str";
    }
    if (truststorePass == null) {
      truststorePass="String_Node_Str";
    }
    sslcontext=SSLContext.getInstance("String_Node_Str");
    KeyManager[] keystoreManagers=null;
    if (keystorePath != null) {
      KeyManagerFactory kmf=KeyManagerFactory.getInstance("String_Node_Str");
      KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
      ks.load(new FileInputStream(keystorePath),keystorePass.toCharArray());
      kmf.init(ks,keystorePass.toCharArray());
      keystoreManagers=kmf.getKeyManagers();
    }
    TrustManager[] truststoreManagers=null;
    if (trustStorePath != null) {
      TrustManagerFactory tmf=TrustManagerFactory.getInstance("String_Node_Str");
      KeyStore tks=KeyStore.getInstance(KeyStore.getDefaultType());
      tks.load(new FileInputStream(trustStorePath),truststorePass.toCharArray());
      tmf.init(tks);
      truststoreManagers=tmf.getTrustManagers();
    }
 else {
      truststoreManagers=new TrustManager[]{new TrustAnyTrustManager()};
    }
    sslcontext.init(keystoreManagers,truststoreManagers,null);
  }
  return sslcontext;
}

Fixed version (ground truth):
public static SSLContext getSSLContext(String userDir) throws Exception {
  if (sslcontext == null) {
    String keystorePath=System.getProperty(TAC_SSL_CLIENT_KEY);
    String trustStorePath=System.getProperty(TAC_SSL_CLIENT_TRUST_KEY);
    String keystorePass=System.getProperty(TAC_SSL_KEYSTORE_PASS);
    String truststorePass=System.getProperty(TAC_SSL_TRUSTSTORE_PASS);
    if (keystorePath == null) {
      File keystorePathFile=new File(userDir + TAC_SSL_KEYSTORE);
      if (keystorePathFile.exists()) {
        keystorePath=keystorePathFile.getAbsolutePath();
      }
    }
    if (trustStorePath == null) {
      File trustStorePathFile=new File(userDir + TAC_SSL_TRUSTSTORE);
      if (trustStorePathFile.exists()) {
        trustStorePath=trustStorePathFile.getAbsolutePath();
      }
    }
    if (keystorePass == null) {
      keystorePass="String_Node_Str";
    }
    if (truststorePass == null) {
      truststorePass="String_Node_Str";
    }
    sslcontext=SSLContext.getInstance("String_Node_Str");
    KeyManager[] keystoreManagers=null;
    if (keystorePath != null) {
      KeyManagerFactory kmf=KeyManagerFactory.getInstance("String_Node_Str");
      KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
      ks.load(new FileInputStream(keystorePath),keystorePass.toCharArray());
      kmf.init(ks,keystorePass.toCharArray());
      keystoreManagers=kmf.getKeyManagers();
    }
    TrustManager[] truststoreManagers=null;
    if (trustStorePath != null) {
      TrustManagerFactory tmf=TrustManagerFactory.getInstance("String_Node_Str");
      KeyStore tks=KeyStore.getInstance(KeyStore.getDefaultType());
      tks.load(new FileInputStream(trustStorePath),truststorePass.toCharArray());
      tmf.init(tks);
      truststoreManagers=tmf.getTrustManagers();
    }
 else {
      truststoreManagers=new TrustManager[]{new TrustAnyTrustManager()};
    }
    sslcontext.init(keystoreManagers,truststoreManagers,null);
  }
  return sslcontext;
}