Program: 118973
Project: 118973
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  ConnectionsDialog connectionsDialog=new ConnectionsDialog(getShell());
  int open=connectionsDialog.open();
  if (open == Window.OK) {
    LoginFirstTimeStartupActionPageErrorManager iErrorManager=getErrorManager();
    iErrorManager.clearManageConnectionsError();
    iErrorManager.clearManageConnectionsWarn();
    refreshOperationAreaEnable(true);
    List<ConnectionBean> storedConnections=connectionsDialog.getConnections();
    if (storedConnections == null || storedConnections.isEmpty()) {
      defaultConnectionBean=LoginHelper.createDefaultLocalConnection();
      storedConnections=new ArrayList<ConnectionBean>();
      storedConnections.add(defaultConnectionBean);
      LoginHelper.getInstance().setStoredConnections(storedConnections);
      LoginHelper.getInstance().saveConnections(storedConnections);
      setRepositoryContextInContext();
    }
 else     if (storedConnections.size() == 1) {
      defaultConnectionBean=storedConnections.get(0);
      if (defaultConnectionBean.isComplete()) {
        LoginHelper.getInstance().setStoredConnections(storedConnections);
        LoginHelper.getInstance().saveConnections(storedConnections);
        if (LoginHelper.isRemoteConnection(defaultConnectionBean)) {
          try {
            gotoNextPage();
            return;
          }
 catch (          Throwable e1) {
            CommonExceptionHandler.process(e1);
          }
        }
 else {
          setRepositoryContextInContext();
        }
      }
 else {
        iErrorManager.setManageConnectionsError(Messages.getString("String_Node_Str"));
        refreshOperationAreaEnable(false);
      }
    }
 else {
      try {
        LoginHelper.getInstance().setStoredConnections(storedConnections);
        LoginHelper.getInstance().saveConnections(storedConnections);
        gotoNextPage();
        return;
      }
 catch (      Throwable e1) {
        CommonExceptionHandler.process(e1);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  ConnectionsDialog connectionsDialog=new ConnectionsDialog(getShell());
  int open=connectionsDialog.open();
  if (open == Window.OK) {
    LoginFirstTimeStartupActionPageErrorManager iErrorManager=getErrorManager();
    iErrorManager.clearManageConnectionsError();
    iErrorManager.clearManageConnectionsWarn();
    refreshOperationAreaEnable(true);
    List<ConnectionBean> storedConnections=connectionsDialog.getConnections();
    if (storedConnections == null || storedConnections.isEmpty()) {
      defaultConnectionBean=LoginHelper.createDefaultLocalConnection();
      storedConnections=new ArrayList<ConnectionBean>();
      storedConnections.add(defaultConnectionBean);
      LoginHelper.getInstance().setStoredConnections(storedConnections);
      LoginHelper.getInstance().saveConnections(storedConnections);
      setRepositoryContextInContext();
    }
 else     if (storedConnections.size() == 1) {
      defaultConnectionBean=storedConnections.get(0);
      if (defaultConnectionBean.isComplete()) {
        LoginHelper.getInstance().setStoredConnections(storedConnections);
        LoginHelper.getInstance().saveConnections(storedConnections);
        boolean shouldGotoNextPage=false;
        if (LoginHelper.isRemoteConnection(defaultConnectionBean)) {
          shouldGotoNextPage=true;
        }
 else         if (!LoginHelper.isWorkspaceSame(defaultConnectionBean)) {
          shouldGotoNextPage=true;
        }
 else {
          shouldGotoNextPage=false;
        }
        if (shouldGotoNextPage) {
          try {
            gotoNextPage();
            return;
          }
 catch (          Throwable e1) {
            CommonExceptionHandler.process(e1);
          }
        }
 else {
          setRepositoryContextInContext();
        }
      }
 else {
        iErrorManager.setManageConnectionsError(Messages.getString("String_Node_Str"));
        refreshOperationAreaEnable(false);
      }
    }
 else {
      try {
        LoginHelper.getInstance().setStoredConnections(storedConnections);
        LoginHelper.getInstance().saveConnections(storedConnections);
        gotoNextPage();
        return;
      }
 catch (      Throwable e1) {
        CommonExceptionHandler.process(e1);
      }
    }
  }
}