Program: 136026
Project: 136026
Buggy source:
/** 
 * Launch TLC or SANY
 * @param mode
 * @param userPased true, if the action is performed on behalf of the user action (explicit click on the launch button)
 */
public void launchModel(String mode,boolean userPased){
  if (Activator.isSpecManagerInstantiated()) {
    Spec spec=Activator.getSpecManager().getSpecLoaded();
    if (spec == null || spec.getStatus() != IParseConstants.PARSED) {
      if (mode == TLCModelLaunchDelegate.MODE_MODELCHECK) {
        MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
      }
 else       if (mode == TLCModelLaunchDelegate.MODE_GENERATE) {
        if (userPased) {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
 else {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
      }
      return;
    }
  }
 else {
    Activator.logDebug("String_Node_Str");
    return;
  }
  UIHelper.runUISync(validateRunable);
  IProgressMonitor monitor=new NullProgressMonitor();
  if (isDirty()) {
    doSave(new SubProgressMonitor(monitor,1));
  }
  if (!isComplete()) {
    if (userPased) {
      MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
      return;
    }
  }
 else {
    try {
      if (mode.equals(TLCModelLaunchDelegate.MODE_MODELCHECK)) {
        int autoLockTime=TLCUIActivator.getDefault().getPreferenceStore().getInt(ITLCPreferenceConstants.I_TLC_AUTO_LOCK_MODEL_TIME);
        getConfig().setAttribute(IConfigurationConstants.LAUNCH_AUTO_LOCK_MODEL_TIME,autoLockTime);
        getConfig().doSave();
      }
      getConfig().launch(mode,new SubProgressMonitor(monitor,1),true);
      TLCErrorView errorView=(TLCErrorView)UIHelper.findView(TLCErrorView.ID);
      if (errorView != null) {
        errorView.clear();
      }
    }
 catch (    CoreException e) {
      TLCUIActivator.logError("String_Node_Str" + getConfig().getName(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Launch TLC or SANY
 * @param mode
 * @param userPased true, if the action is performed on behalf of the user action (explicit click on the launch button)
 */
public void launchModel(String mode,boolean userPased){
  if (Activator.isSpecManagerInstantiated()) {
    Spec spec=Activator.getSpecManager().getSpecLoaded();
    if (spec == null || spec.getStatus() != IParseConstants.PARSED) {
      if (mode == TLCModelLaunchDelegate.MODE_MODELCHECK) {
        MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
      }
 else       if (mode == TLCModelLaunchDelegate.MODE_GENERATE) {
        if (userPased) {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
 else {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
        }
      }
      return;
    }
  }
 else {
    Activator.logDebug("String_Node_Str");
    return;
  }
  UIHelper.runUISync(validateRunable);
  IProgressMonitor monitor=new NullProgressMonitor();
  if (isDirty()) {
    doSave(new SubProgressMonitor(monitor,1));
  }
  if (!isComplete()) {
    if (userPased) {
      MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
      return;
    }
  }
 else {
    try {
      if (mode.equals(TLCModelLaunchDelegate.MODE_MODELCHECK)) {
        int autoLockTime=TLCUIActivator.getDefault().getPreferenceStore().getInt(ITLCPreferenceConstants.I_TLC_AUTO_LOCK_MODEL_TIME);
        getConfig().setAttribute(IConfigurationConstants.LAUNCH_AUTO_LOCK_MODEL_TIME,autoLockTime);
        getConfig().doSave();
      }
      getConfig().launch(mode,new SubProgressMonitor(monitor,1),true);
      if (mode.equals(TLCModelLaunchDelegate.MODE_MODELCHECK)) {
        TLCErrorView errorView=(TLCErrorView)UIHelper.findView(TLCErrorView.ID);
        if (errorView != null) {
          errorView.clear();
        }
      }
    }
 catch (    CoreException e) {
      TLCUIActivator.logError("String_Node_Str" + getConfig().getName(),e);
    }
  }
}