Program: 127824
Project: 127824
Buggy source:
/** 
 * DOC tang Comment method "logOnProject".
 * @param project
 * @param monitorWrap
 * @throws PersistenceException
 * @throws LoginException
 */
public void logOnProject(Project project,IProgressMonitor monitor) throws LoginException, PersistenceException {
  try {
    TimeMeasure.display=CommonsPlugin.isDebugMode();
    TimeMeasure.displaySteps=CommonsPlugin.isDebugMode();
    TimeMeasure.measureActive=CommonsPlugin.isDebugMode();
    TimeMeasure.begin("String_Node_Str");
    try {
      System.getProperties().put("String_Node_Str",Boolean.FALSE.toString());
      fullLogonFinished=false;
      SubMonitor subMonitor=SubMonitor.convert(monitor,MAX_TASKS);
      SubMonitor currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      LanguageManager.reset();
      getRepositoryContext().setProject(project);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      this.repositoryFactoryFromProvider.beforeLogon(project);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      checkProjectCompatibility(project);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask("String_Node_Str",1);
      executeMigrations(project,true,currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      this.repositoryFactoryFromProvider.logOnProject(project);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      emptyTempFolder(project);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      coreService.componentsReset();
      coreService.initializeComponents(currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      executeMigrations(project,false,currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      coreService.deleteAllJobs(false);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      try {
        coreService.syncAllRoutines();
        coreService.syncAllBeans();
      }
 catch (      SystemException e1) {
      }
      if (PluginChecker.isRulesPluginLoaded()) {
        coreService.syncAllRules();
      }
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      coreService.syncLibraries(currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      if (PluginChecker.isSAPWizardPluginLoaded()) {
        coreService.synchronizeSapLib();
      }
      coreService.resetUniservLibraries();
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IWorkspaceDescription description=workspace.getDescription();
      description.setAutoBuilding(false);
      try {
        workspace.setDescription(description);
      }
 catch (      CoreException e) {
      }
      coreService.createStatsLogAndImplicitParamter(project);
      coreService.synchronizeMapptingXML();
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      fullLogonFinished=true;
    }
  finally {
      TimeMeasure.end("String_Node_Str");
      TimeMeasure.display=false;
      TimeMeasure.displaySteps=false;
      TimeMeasure.measureActive=false;
    }
    String str[]=new String[]{getRepositoryContext().getUser() + "String_Node_Str",projectManager.getCurrentProject() + "String_Node_Str"};
    log.info(Messages.getString("String_Node_Str",str));
  }
 catch (  LoginException e) {
    logOffProject();
    throw e;
  }
catch (  PersistenceException e) {
    logOffProject();
    throw e;
  }
catch (  RuntimeException e) {
    logOffProject();
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * DOC tang Comment method "logOnProject".
 * @param project
 * @param monitorWrap
 * @throws PersistenceException
 * @throws LoginException
 */
public void logOnProject(Project project,IProgressMonitor monitor) throws LoginException, PersistenceException {
  try {
    TimeMeasure.display=CommonsPlugin.isDebugMode();
    TimeMeasure.displaySteps=CommonsPlugin.isDebugMode();
    TimeMeasure.measureActive=CommonsPlugin.isDebugMode();
    TimeMeasure.begin("String_Node_Str");
    try {
      System.getProperties().put("String_Node_Str",Boolean.FALSE.toString());
      fullLogonFinished=false;
      SubMonitor subMonitor=SubMonitor.convert(monitor,MAX_TASKS);
      SubMonitor currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      LanguageManager.reset();
      getRepositoryContext().setProject(project);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      this.repositoryFactoryFromProvider.beforeLogon(project);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      checkProjectCompatibility(project);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask("String_Node_Str",1);
      executeMigrations(project,true,currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      this.repositoryFactoryFromProvider.logOnProject(project);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      emptyTempFolder(project);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      coreService.componentsReset();
      coreService.initializeComponents(currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      executeMigrations(project,false,currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      coreService.deleteAllJobs(false);
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      try {
        coreService.syncAllRoutines();
        coreService.syncAllBeans();
      }
 catch (      SystemException e1) {
      }
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      if (PluginChecker.isRulesPluginLoaded()) {
        coreService.syncAllRules();
      }
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      currentMonitor=subMonitor.newChild(1,SubMonitor.SUPPRESS_NONE);
      currentMonitor.beginTask(Messages.getString("String_Node_Str"),1);
      coreService.syncLibraries(currentMonitor);
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      if (PluginChecker.isSAPWizardPluginLoaded()) {
        coreService.synchronizeSapLib();
      }
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      coreService.resetUniservLibraries();
      TimeMeasure.step("String_Node_Str","String_Node_Str");
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IWorkspaceDescription description=workspace.getDescription();
      description.setAutoBuilding(false);
      try {
        workspace.setDescription(description);
      }
 catch (      CoreException e) {
      }
      coreService.createStatsLogAndImplicitParamter(project);
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      coreService.synchronizeMapptingXML();
      if (monitor != null && monitor.isCanceled()) {
        throw new OperationCanceledException("String_Node_Str");
      }
      fullLogonFinished=true;
    }
  finally {
      TimeMeasure.end("String_Node_Str");
      TimeMeasure.display=false;
      TimeMeasure.displaySteps=false;
      TimeMeasure.measureActive=false;
    }
    String str[]=new String[]{getRepositoryContext().getUser() + "String_Node_Str",projectManager.getCurrentProject() + "String_Node_Str"};
    log.info(Messages.getString("String_Node_Str",str));
  }
 catch (  LoginException e) {
    logOffProject();
    throw e;
  }
catch (  PersistenceException e) {
    logOffProject();
    throw e;
  }
catch (  RuntimeException e) {
    logOffProject();
    throw e;
  }
}