Program: 126473
Project: 126473
Buggy source:
protected SalesforceModuleParseAPI checkSalesfoceLogin(final String proxy,final String endPoint,final String username,final String password,final String timeOut,final String proxyHost,final String proxyPort,final String proxyUsername,final String proxyPassword){
  final List<String> errors=new ArrayList<String>();
  salesforceAPI.setLogin(false);
  ProgressMonitorDialog dialog=new ProgressMonitorDialog(getShell());
  try {
    dialog.run(true,false,new IRunnableWithProgress(){
      public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        monitor.beginTask(Messages.getString("String_Node_Str"),IProgressMonitor.UNKNOWN);
        if (salesforceAPI == null) {
          try {
            salesforceAPI=new SalesforceModuleParseAPI();
          }
 catch (          Throwable e) {
            ExceptionHandler.process(e);
          }
        }
        boolean socksProxy=false;
        boolean httpProxy=false;
        boolean httpsProxy=false;
        if (SalesforceModuleParseAPI.USE_SOCKS_PROXY.equals(proxy)) {
          socksProxy=true;
        }
        if (SalesforceModuleParseAPI.USE_HTTP_PROXY.equals(proxy)) {
          if (endPoint.startsWith("String_Node_Str")) {
            httpsProxy=true;
          }
 else {
            httpProxy=true;
          }
        }
        salesforceAPI.resetAllProxy();
        salesforceAPI.setProxy(proxyHost,proxyPort,proxyUsername,proxyPassword,httpProxy,socksProxy,httpsProxy);
        try {
          ArrayList loginList=salesforceAPI.login(endPoint,username,password,timeOut);
          if (loginList != null) {
            for (int i=0; i < loginList.size(); i++) {
              if (loginList.get(i) instanceof SoapBindingStub) {
                binding=(SoapBindingStub)loginList.get(i);
              }
              if (loginList.get(i) instanceof SforceServiceStub) {
                bindingPartner=(SforceServiceStub)loginList.get(i);
              }
            }
          }
          salesforceAPI.setLogin(true);
        }
 catch (        Throwable e) {
          errors.add(e.getMessage());
          ExceptionHandler.process(e);
        }
 finally {
          salesforceAPI.resetAllProxy();
        }
        monitor.done();
      }
    }
);
  }
 catch (  InvocationTargetException e1) {
    ExceptionHandler.process(e1);
  }
catch (  InterruptedException e2) {
    ExceptionHandler.process(e2);
  }
  if (salesforceAPI.isLogin()) {
    MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
 else {
    String mainMsg=Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str");
    String error=errors.size() > 0 ? errors.get(0) : "String_Node_Str";
    new ErrorDialogWidthDetailArea(getShell(),PID,mainMsg,error);
  }
  return salesforceAPI;
}

Fixed version (ground truth):
protected SalesforceModuleParseAPI checkSalesfoceLogin(final String proxy,final String endPoint,final String username,final String password,final String timeOut,final String proxyHost,final String proxyPort,final String proxyUsername,final String proxyPassword){
  final List<String> errors=new ArrayList<String>();
  salesforceAPI.setLogin(false);
  ProgressMonitorDialog dialog=new ProgressMonitorDialog(getShell());
  try {
    dialog.run(true,false,new IRunnableWithProgress(){
      @Override public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        monitor.beginTask(Messages.getString("String_Node_Str"),IProgressMonitor.UNKNOWN);
        if (salesforceAPI == null) {
          try {
            salesforceAPI=new SalesforceModuleParseAPI();
          }
 catch (          Throwable e) {
            ExceptionHandler.process(e);
          }
        }
        boolean socksProxy=false;
        boolean httpProxy=false;
        boolean httpsProxy=false;
        if (SalesforceModuleParseAPI.USE_SOCKS_PROXY.equals(proxy)) {
          socksProxy=true;
        }
        if (SalesforceModuleParseAPI.USE_HTTP_PROXY.equals(proxy)) {
          if (endPoint.startsWith("String_Node_Str")) {
            httpsProxy=true;
          }
 else {
            httpProxy=true;
          }
        }
        salesforceAPI.resetAllProxy();
        salesforceAPI.setProxy(proxyHost,proxyPort,proxyUsername,proxyPassword,httpProxy,socksProxy,httpsProxy);
        try {
          ArrayList loginList=salesforceAPI.login(endPoint,username,password,timeOut);
          if (loginList != null) {
            for (int i=0; i < loginList.size(); i++) {
              if (loginList.get(i) instanceof SoapBindingStub) {
                binding=(SoapBindingStub)loginList.get(i);
              }
              if (loginList.get(i) instanceof SforceManagement) {
                sforceMgr=(SforceManagement)loginList.get(i);
              }
            }
          }
          salesforceAPI.setLogin(true);
        }
 catch (        Throwable e) {
          errors.add(e.getMessage());
          ExceptionHandler.process(e);
        }
 finally {
          salesforceAPI.resetAllProxy();
        }
        monitor.done();
      }
    }
);
  }
 catch (  InvocationTargetException e1) {
    ExceptionHandler.process(e1);
  }
catch (  InterruptedException e2) {
    ExceptionHandler.process(e2);
  }
  if (salesforceAPI.isLogin()) {
    MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
 else {
    String mainMsg=Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str");
    String error=errors.size() > 0 ? errors.get(0) : "String_Node_Str";
    new ErrorDialogWidthDetailArea(getShell(),PID,mainMsg,error);
  }
  return salesforceAPI;
}