Program: 96377
Project: 96377
Buggy source:
/** 
 * Shows the db login dialog.
 */
private void showLoginDataDialog(){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      DBLoginDialog dialog=new DBLoginDialog(Plugin.getShell());
      dialog.create();
      DialogUtils.setWidgetNameForModalDialog(dialog);
      dialog.open();
      if (dialog.getReturnCode() == Window.OK) {
        if (!(dialog.isEmbeddedDb())) {
          Hibernator.setUser(dialog.getUser());
          Hibernator.setPw(dialog.getPwd());
        }
        Hibernator.setDbConnectionName(dialog.getDatabaseConnection().getConnectionInfo());
        if (Hibernator.getSelectDBAction()) {
          if (Hibernator.instance() != null) {
            CompNamePM.dispose();
            GeneralStorage.getInstance().dispose();
            if (LockManager.isRunning()) {
              LockManager.instance().dispose();
            }
            Hibernator.instance().dispose();
            DataEventDispatcher.getInstance().fireTestresultChanged(TestresultState.Clear);
          }
          ConnectDbOperation connDbOp=new ConnectDbOperation();
          try {
            PlatformUI.getWorkbench().getProgressService().run(true,false,connDbOp);
          }
 catch (          InvocationTargetException e) {
            hibernateInit=false;
          }
catch (          InterruptedException e) {
            hibernateInit=false;
          }
          if (hibernateInit) {
            Utils.clearClient();
            LockManager.instance();
            Plugin.getDefault().writeLineToConsole(Messages.SelectDatabaseActionInfoConnectSuccessful,true);
          }
 else {
            Utils.clearClient(true);
            Plugin.getDefault().writeLineToConsole(Messages.SelectDatabaseActionInfoConnectFailed,true);
          }
          Plugin.stopLongRunning();
        }
      }
 else {
        Hibernator.setUser(null);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Shows the db login dialog.
 */
private void showLoginDataDialog(){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      DBLoginDialog dialog=new DBLoginDialog(Plugin.getShell());
      dialog.create();
      DialogUtils.setWidgetNameForModalDialog(dialog);
      dialog.open();
      if (dialog.getReturnCode() == Window.OK) {
        Utils.clearClient();
        if (!(dialog.isEmbeddedDb())) {
          Hibernator.setUser(dialog.getUser());
          Hibernator.setPw(dialog.getPwd());
        }
        Hibernator.setDbConnectionName(dialog.getDatabaseConnection().getConnectionInfo());
        if (Hibernator.getSelectDBAction()) {
          if (Hibernator.instance() != null) {
            CompNamePM.dispose();
            GeneralStorage.getInstance().dispose();
            if (LockManager.isRunning()) {
              LockManager.instance().dispose();
            }
            Hibernator.instance().dispose();
          }
          ConnectDbOperation connDbOp=new ConnectDbOperation();
          try {
            PlatformUI.getWorkbench().getProgressService().run(true,false,connDbOp);
          }
 catch (          InvocationTargetException e) {
            hibernateInit=false;
          }
catch (          InterruptedException e) {
            hibernateInit=false;
          }
          if (hibernateInit) {
            LockManager.instance();
            Plugin.getDefault().writeLineToConsole(Messages.SelectDatabaseActionInfoConnectSuccessful,true);
          }
 else {
            Plugin.getDefault().writeLineToConsole(Messages.SelectDatabaseActionInfoConnectFailed,true);
          }
          Plugin.stopLongRunning();
        }
      }
 else {
        Hibernator.setUser(null);
      }
    }
  }
);
}