Program: 97334
Project: 97334
Buggy source:
@Test public void testRebaselineWithConflictsAbandon() throws Exception {
  ConflictResolverOperation resolverOperation=new ConflictResolverOperation("String_Node_Str",MergeManagerTest.class.getCanonicalName()){
    @Override protected void doWork(    IProgressMonitor monitor) throws Exception {
      assertTrue("String_Node_Str",wasExecuted());
    }
  }
;
  UpdateBranchOperation update=new UpdateBranchOperation(workingBranch,resolverOperation);
  Operations.executeAsJob(update,true);
  Thread.sleep(1000);
  assertTrue("String_Node_Str",BranchManager.getMergeBranches(workingBranch).size() == 1);
  assertTrue("String_Node_Str",workingBranch.getBranchState().isRebaselineInProgress());
  boolean committed=CommitHandler.commitBranch(new ConflictManagerExternal(DemoBranches.SAW_Bld_2,workingBranch),false,true);
  assertTrue("String_Node_Str",!committed);
  assertTrue("String_Node_Str",BranchManager.getMergeBranches(workingBranch).size() == 1);
  RebaselineInProgressHandler.cancelCurrentUpdate(workingBranch,true);
  Thread.sleep(1000);
  BranchManager.persist(workingBranch);
  committed=CommitHandler.commitBranch(new ConflictManagerExternal(DemoBranches.SAW_Bld_2,workingBranch),false,true);
  assertTrue("String_Node_Str",committed);
  update=new UpdateBranchOperation(workingBranch,resolverOperation);
  Operations.executeAsJob(update,true);
  assertTrue("String_Node_Str",!workingBranch.getBranchState().isRebaselineInProgress() && !workingBranch.getBranchState().isRebaselineInProgress());
  Artifact artOnSaw2=ArtifactQuery.getArtifactFromToken(NewArtifactToken,DemoBranches.SAW_Bld_2);
  Operations.executeWorkAndCheckStatus(new PurgeArtifacts(Collections.singleton(artOnSaw2)));
  Thread.sleep(1000);
}

Fixed version (ground truth):
@Test public void testRebaselineWithConflictsAbandon() throws Exception {
  ConflictResolverOperation resolverOperation=new ConflictResolverOperation("String_Node_Str",MergeManagerTest.class.getCanonicalName()){
    @Override protected void doWork(    IProgressMonitor monitor) throws Exception {
      assertTrue("String_Node_Str",wasExecuted());
    }
  }
;
  UpdateBranchOperation update=new UpdateBranchOperation(workingBranch,resolverOperation);
  Operations.executeWorkAndCheckStatus(update);
  assertTrue("String_Node_Str",BranchManager.getMergeBranches(workingBranch).size() == 1);
  assertTrue("String_Node_Str",workingBranch.getBranchState().isRebaselineInProgress());
  boolean committed=CommitHandler.commitBranch(new ConflictManagerExternal(DemoBranches.SAW_Bld_2,workingBranch),false,true);
  assertTrue("String_Node_Str",!committed);
  assertTrue("String_Node_Str",BranchManager.getMergeBranches(workingBranch).size() == 1);
  RebaselineInProgressHandler.cancelCurrentUpdate(workingBranch,true);
  Thread.sleep(1000);
  BranchManager.persist(workingBranch);
  committed=CommitHandler.commitBranch(new ConflictManagerExternal(DemoBranches.SAW_Bld_2,workingBranch),false,true);
  assertTrue("String_Node_Str",committed);
  update=new UpdateBranchOperation(workingBranch,resolverOperation);
  Operations.executeWorkAndCheckStatus(update);
  assertTrue("String_Node_Str",!workingBranch.getBranchState().isRebaselineInProgress() && !workingBranch.getBranchState().isRebaselineInProgress());
  Artifact artOnSaw2=ArtifactQuery.getArtifactFromToken(NewArtifactToken,DemoBranches.SAW_Bld_2);
  Operations.executeWorkAndCheckStatus(new PurgeArtifacts(Collections.singleton(artOnSaw2)));
  Thread.sleep(1000);
}