nus-yam/ex-repair huggingface dataset:
Program: 97483
Project: 97483
Buggy source:
@After public void cleanup() throws Exception {
  if (BranchManager.branchExists(workingBranch)) {
    BranchManager.purgeBranch(workingBranch);
  }
  Operations.executeWorkAndCheckStatus(new PurgeUnusedBackingDataAndTransactions(NullOperationLogger.getSingleton()));
}

Fixed version (ground truth):
@After public void cleanup() throws Exception {
  if (BranchManager.branchExists(workingBranch)) {
    BranchManager.purgeBranch(workingBranch);
  }
}
Program: 97484
Project: 97484
Buggy source:
@Ignore @Test public void testPurge() throws Exception {
  Operations.executeWorkAndCheckStatus(new PurgeUnusedBackingDataAndTransactions(NullOperationLogger.getSingleton()));
  Map<String,Integer> initialRowCount=TestUtil.getTableRowCounts(TABLES);
  Collection<Artifact> softArts=TestUtil.createSimpleArtifacts(CoreArtifactTypes.SoftwareRequirement,10,method.getQualifiedTestName(),workingBranch);
  Artifacts.persistInTransaction(method.getQualifiedTestName(),softArts);
  for (  Artifact softArt : softArts) {
    softArt.addAttribute(CoreAttributeTypes.StaticId,method.getQualifiedTestName());
    softArt.persist(method.getQualifiedTestName());
  }
  Asserts.assertThatIncreased(initialRowCount,TestUtil.getTableRowCounts(TABLES));
  Operations.executeWorkAndCheckStatus(new PurgeArtifacts(softArts));
  Asserts.assertThatEquals(initialRowCount,TestUtil.getTableRowCounts(TABLES));
}

Fixed version (ground truth):
@Ignore @Test public void testPurge() throws Exception {
  Map<String,Integer> initialRowCount=TestUtil.getTableRowCounts(TABLES);
  Collection<Artifact> softArts=TestUtil.createSimpleArtifacts(CoreArtifactTypes.SoftwareRequirement,10,method.getQualifiedTestName(),workingBranch);
  Artifacts.persistInTransaction(method.getQualifiedTestName(),softArts);
  for (  Artifact softArt : softArts) {
    softArt.addAttribute(CoreAttributeTypes.StaticId,method.getQualifiedTestName());
    softArt.persist(method.getQualifiedTestName());
  }
  Asserts.assertThatIncreased(initialRowCount,TestUtil.getTableRowCounts(TABLES));
  Operations.executeWorkAndCheckStatus(new PurgeArtifacts(softArts));
  Asserts.assertThatEquals(initialRowCount,TestUtil.getTableRowCounts(TABLES));
}
Program: 97485
Project: 97485
Buggy source:
@After public void tearDown() throws Exception {
  if (BranchManager.branchExists(branch)) {
    BranchManager.purgeBranch(branch);
  }
  Operations.executeWorkAndCheckStatus(new PurgeUnusedBackingDataAndTransactions(NullOperationLogger.getSingleton()));
}

Fixed version (ground truth):
@After public void tearDown() throws Exception {
  if (BranchManager.branchExists(branch)) {
    BranchManager.purgeBranch(branch);
  }
}
Program: 97486
Project: 97486
Buggy source:
public TestPrompt(String prompt,PromptResponseType type){
  super();
  this.prompt=prompt;
  this.waitForResponse=type == PromptResponseType.SCRIPT_PAUSE || type == PromptResponseType.PASS_FAIL || type == PromptResponseType.SCRIPT_STEP || type == PromptResponseType.USER_INPUT ? true : false;
  this.ofpStep=type == PromptResponseType.SCRIPT_STEP ? true : false;
  this.type=type;
}

Fixed version (ground truth):
public TestPrompt(String prompt,PromptResponseType type){
  super();
  this.prompt=XmlSupport.convertNonPrintableCharacers(prompt);
  this.waitForResponse=type == PromptResponseType.SCRIPT_PAUSE || type == PromptResponseType.PASS_FAIL || type == PromptResponseType.SCRIPT_STEP || type == PromptResponseType.USER_INPUT ? true : false;
  this.ofpStep=type == PromptResponseType.SCRIPT_STEP ? true : false;
  this.type=type;
}
Program: 97487
Project: 97487
Buggy source:
private void importRequirements(IOseeBranch branch,String rootArtifactName,IArtifactType requirementType,String filename) throws Exception {
  if (DEBUG) {
    OseeLog.logf(Activator.class,Level.INFO,"String_Node_Str",rootArtifactName,branch);
  }
  Artifact systemReq=ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.Folder,rootArtifactName,branch);
  File file=Activator.getInstance().getPluginFile(filename);
  IArtifactImportResolver artifactResolver=new NewArtifactImportResolver(requirementType,CoreArtifactTypes.Heading);
  IArtifactExtractor extractor=new WordOutlineExtractor();
  extractor.setDelegate(new WordOutlineExtractorDelegate());
  ArtifactImportOperationParameter importOptions=new ArtifactImportOperationParameter();
  importOptions.setSourceFile(file);
  importOptions.setDestinationArtifact(systemReq);
  importOptions.setExtractor(extractor);
  importOptions.setResolver(artifactResolver);
  IOperation operation=ArtifactImportOperationFactory.completeOperation(importOptions);
  Operations.executeWorkAndCheckStatus(operation);
  if (systemReq.getChildren().isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void importRequirements(IOseeBranch branch,IArtifactType requirementType,String folderName,String filename) throws Exception {
  if (DEBUG) {
    OseeLog.logf(Activator.class,Level.INFO,"String_Node_Str",folderName,branch);
  }
  Artifact systemReq=ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.Folder,folderName,branch);
  File file=Activator.getInstance().getPluginFile(filename);
  IArtifactImportResolver artifactResolver=new NewArtifactImportResolver(requirementType,CoreArtifactTypes.Heading);
  IArtifactExtractor extractor=new WordOutlineExtractor();
  extractor.setDelegate(new WordOutlineExtractorDelegate());
  ArtifactImportOperationParameter importOptions=new ArtifactImportOperationParameter();
  importOptions.setSourceFile(file);
  importOptions.setDestinationArtifact(systemReq);
  importOptions.setExtractor(extractor);
  importOptions.setResolver(artifactResolver);
  IOperation operation=ArtifactImportOperationFactory.completeOperation(importOptions);
  Operations.executeWorkAndCheckStatus(operation);
  if (systemReq.getChildren().isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 97488
Project: 97488
Buggy source:
private void demoDbImportReqsTx(){
  try {
    importRequirements(DemoSawBuilds.SAW_Bld_1,CoreArtifactTypes.SoftwareRequirement.getName() + "String_Node_Str",CoreArtifactTypes.SoftwareRequirement,"String_Node_Str");
    importRequirements(DemoSawBuilds.SAW_Bld_1,CoreArtifactTypes.SystemRequirementMSWord.getName() + "String_Node_Str",CoreArtifactTypes.SystemRequirementMSWord,"String_Node_Str");
    importRequirements(DemoSawBuilds.SAW_Bld_1,CoreArtifactTypes.SubsystemRequirementMSWord.getName() + "String_Node_Str",CoreArtifactTypes.SubsystemRequirementMSWord,"String_Node_Str");
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
}

Fixed version (ground truth):
private void demoDbImportReqsTx(){
  try {
    importRequirements(DemoSawBuilds.SAW_Bld_1,CoreArtifactTypes.SoftwareRequirement,"String_Node_Str","String_Node_Str");
    importRequirements(DemoSawBuilds.SAW_Bld_1,CoreArtifactTypes.SystemRequirementMSWord,"String_Node_Str","String_Node_Str");
    importRequirements(DemoSawBuilds.SAW_Bld_1,CoreArtifactTypes.SubsystemRequirementMSWord,"String_Node_Str","String_Node_Str");
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
}
Program: 97489
Project: 97489
Buggy source:
@Override public void run() throws OseeCoreException {
  try {
    IOseeBranch branch=DemoBranches.SAW_Bld_1;
    importRequirements(branch,CoreArtifactTypes.SoftwareRequirement,"String_Node_Str");
    importRequirements(branch,CoreArtifactTypes.SystemRequirementMSWord,"String_Node_Str");
    importRequirements(branch,CoreArtifactTypes.SubsystemRequirementMSWord,"String_Node_Str");
    SkynetTransaction demoDbTraceability=TransactionManager.createTransaction(branch,"String_Node_Str");
    demoDbTraceabilityTx(demoDbTraceability,branch);
    demoDbTraceability.execute();
    if (DEBUG) {
      OseeLog.log(AddRequirementData.class,Level.INFO,"String_Node_Str");
    }
    Branch childBranch=BranchManager.createBaselineBranch(DemoBranches.SAW_Bld_1,DemoBranches.SAW_Bld_2);
    sleep(5000);
    ConnectionHandler.runPreparedUpdate(UPDATE_BRANCH_TYPE,new Object[]{BranchType.BASELINE.getValue(),childBranch.getId()});
    BranchManager.refreshBranches();
  }
 catch (  Exception ex) {
    OseeExceptions.wrapAndThrow(ex);
  }
}

Fixed version (ground truth):
@Override public void run() throws OseeCoreException {
  try {
    IOseeBranch branch=DemoBranches.SAW_Bld_1;
    importRequirements(branch,CoreArtifactTypes.SoftwareRequirement,"String_Node_Str","String_Node_Str");
    importRequirements(branch,CoreArtifactTypes.SystemRequirementMSWord,"String_Node_Str","String_Node_Str");
    importRequirements(branch,CoreArtifactTypes.SubsystemRequirementMSWord,"String_Node_Str","String_Node_Str");
    SkynetTransaction demoDbTraceability=TransactionManager.createTransaction(branch,"String_Node_Str");
    demoDbTraceabilityTx(demoDbTraceability,branch);
    demoDbTraceability.execute();
    if (DEBUG) {
      OseeLog.log(AddRequirementData.class,Level.INFO,"String_Node_Str");
    }
    Branch childBranch=BranchManager.createBaselineBranch(DemoBranches.SAW_Bld_1,DemoBranches.SAW_Bld_2);
    sleep(5000);
    ConnectionHandler.runPreparedUpdate(UPDATE_BRANCH_TYPE,new Object[]{BranchType.BASELINE.getValue(),childBranch.getId()});
    BranchManager.refreshBranches();
  }
 catch (  Exception ex) {
    OseeExceptions.wrapAndThrow(ex);
  }
}
Program: 97490
Project: 97490
Buggy source:
private void importRequirements(IOseeBranch branch,IArtifactType requirementType,String filename) throws Exception {
  String rootArtifactName=toPlural(requirementType.getName());
  if (DEBUG) {
    OseeLog.logf(AddRequirementData.class,Level.INFO,"String_Node_Str",rootArtifactName,branch);
  }
  Artifact systemReq=ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.Folder,rootArtifactName,branch);
  IArtifactImportResolver artifactResolver=new NewArtifactImportResolver(requirementType,CoreArtifactTypes.Heading);
  IArtifactExtractor extractor=new WordOutlineExtractor();
  extractor.setDelegate(new WordOutlineExtractorDelegate());
  ArtifactImportOperationParameter importOptions=new ArtifactImportOperationParameter();
  importOptions.setSourceFile(getResourceFile(filename));
  importOptions.setDestinationArtifact(systemReq);
  importOptions.setExtractor(extractor);
  importOptions.setResolver(artifactResolver);
  IOperation operation=ArtifactImportOperationFactory.completeOperation(importOptions);
  Operations.executeWorkAndCheckStatus(operation);
  if (systemReq.getChildren().isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void importRequirements(IOseeBranch branch,IArtifactType requirementType,String folderName,String filename) throws Exception {
  if (DEBUG) {
    OseeLog.logf(AddRequirementData.class,Level.INFO,"String_Node_Str",folderName,branch);
  }
  Artifact systemReq=ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.Folder,folderName,branch);
  IArtifactImportResolver artifactResolver=new NewArtifactImportResolver(requirementType,CoreArtifactTypes.Heading);
  IArtifactExtractor extractor=new WordOutlineExtractor();
  extractor.setDelegate(new WordOutlineExtractorDelegate());
  ArtifactImportOperationParameter importOptions=new ArtifactImportOperationParameter();
  importOptions.setSourceFile(getResourceFile(filename));
  importOptions.setDestinationArtifact(systemReq);
  importOptions.setExtractor(extractor);
  importOptions.setResolver(artifactResolver);
  IOperation operation=ArtifactImportOperationFactory.completeOperation(importOptions);
  Operations.executeWorkAndCheckStatus(operation);
  if (systemReq.getChildren().isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 97491
Project: 97491
Buggy source:
@Override public void run(TableLoadOption... tableLoadOptions) throws Exception {
  String coveragePkgName=String.format("String_Node_Str",getName(),Lib.getDateTimeString());
  coveragePackage=new CoveragePackage(coveragePkgName,CoverageOptionManagerDefault.instance(),new SimpleWorkProductTaskProvider());
  OseeCoveragePackageStore store=new OseeCoveragePackageStore(coveragePackage,CoverageBranches.SAW_Bld_1);
  store.save(coveragePackage.getName(),coveragePackage.getCoverageOptionManager());
  CoverageEditor.open(new CoverageEditorInput(coveragePackage.getName(),store.getArtifact(false),coveragePackage,true));
  CoverageEditor editor=null;
  for (  CoverageEditor coverageEditor : CoverageEditor.getEditors()) {
    if (coverageEditor.getCoverageEditorInput().getCoveragePackageBase() instanceof CoveragePackage) {
      CoveragePackage editorPackage=(CoveragePackage)coverageEditor.getCoverageEditorInput().getCoveragePackageBase();
      if (editorPackage.getGuid().equals(coveragePackage.getGuid())) {
        editor=coverageEditor;
      }
    }
  }
  if (editor == null) {
    AWorkbench.popup("String_Node_Str");
    return;
  }
  editor.simulateImport(blamImportName);
}

Fixed version (ground truth):
@Override public void run(TableLoadOption... tableLoadOptions) throws Exception {
  String coveragePkgName=String.format("String_Node_Str",getName(),Lib.getDateTimeString());
  coveragePackage=new CoveragePackage(coveragePkgName,CoverageOptionManagerDefault.instance(),new SimpleWorkProductTaskProvider());
  OseeCoveragePackageStore store=new OseeCoveragePackageStore(coveragePackage,CoverageBranches.COVERAGE_TEST_BRANCH);
  store.save(coveragePackage.getName(),coveragePackage.getCoverageOptionManager());
  CoverageEditor.open(new CoverageEditorInput(coveragePackage.getName(),store.getArtifact(false),coveragePackage,true));
  CoverageEditor editor=null;
  for (  CoverageEditor coverageEditor : CoverageEditor.getEditors()) {
    if (coverageEditor.getCoverageEditorInput().getCoveragePackageBase() instanceof CoveragePackage) {
      CoveragePackage editorPackage=(CoveragePackage)coverageEditor.getCoverageEditorInput().getCoveragePackageBase();
      if (editorPackage.getGuid().equals(coveragePackage.getGuid())) {
        editor=coverageEditor;
      }
    }
  }
  if (editor == null) {
    AWorkbench.popup("String_Node_Str");
    return;
  }
  editor.simulateImport(blamImportName);
}
Program: 97492
Project: 97492
Buggy source:
@Override public void run(TableLoadOption... tableLoadOptions) throws Exception {
  super.run(tableLoadOptions);
  CoverageUtil.setNavigatorSelectedBranch(CoverageBranches.SAW_Bld_1);
  Artifact coveragePackageArtifact=CoveragePackageTestUtil.getSelectedCoveragePackageFromDialog();
  if (coveragePackageArtifact == null) {
    return;
  }
  CoveragePackage coveragePackage=new OseeCoveragePackageStore(coveragePackageArtifact).getCoveragePackage();
  Result result=CoveragePackageTestUtil.setupCoveragePackageForImport10(coveragePackage,true);
  if (result.isFalse()) {
    AWorkbench.popup(result);
  }
  CoverageEditor.open(new CoverageEditorInput(coveragePackage.getName(),coveragePackageArtifact,coveragePackage,true));
}

Fixed version (ground truth):
@Override public void run(TableLoadOption... tableLoadOptions) throws Exception {
  super.run(tableLoadOptions);
  CoverageUtil.setNavigatorSelectedBranch(CoverageBranches.COVERAGE_TEST_BRANCH);
  Artifact coveragePackageArtifact=CoveragePackageTestUtil.getSelectedCoveragePackageFromDialog();
  if (coveragePackageArtifact == null) {
    return;
  }
  CoveragePackage coveragePackage=new OseeCoveragePackageStore(coveragePackageArtifact).getCoveragePackage();
  Result result=CoveragePackageTestUtil.setupCoveragePackageForImport10(coveragePackage,true);
  if (result.isFalse()) {
    AWorkbench.popup(result);
  }
  CoverageEditor.open(new CoverageEditorInput(coveragePackage.getName(),coveragePackageArtifact,coveragePackage,true));
}
Program: 97493
Project: 97493
Buggy source:
public static Result setupCoveragePackageForImport10(CoveragePackage coveragePackage,boolean testWithDb){
  String errStr=null;
  CoverageItem item=getNavigateButton2getTextLine3CoverageItem(coveragePackage);
  if (item == null) {
    errStr="String_Node_Str";
  }
 else {
    item.setCoverageMethod(CoverageOptionManager.Deactivated_Code);
  }
  item=getNavigateButton2getImageLine3CoverageItem(coveragePackage);
  if (item == null) {
    errStr+="String_Node_Str";
  }
 else {
    item.setCoverageMethod(CoverageOptionManager.Deactivated_Code);
    item.setRationale("String_Node_Str");
  }
  if (Strings.isValid(errStr)) {
    return new Result(errStr);
  }
  if (testWithDb) {
    OseeCoveragePackageStore packageStore=new OseeCoveragePackageStore(coveragePackage,CoverageBranches.SAW_Bld_1);
    packageStore.save(coveragePackage.getName(),coveragePackage.getCoverageOptionManager());
  }
  return Result.TrueResult;
}

Fixed version (ground truth):
public static Result setupCoveragePackageForImport10(CoveragePackage coveragePackage,boolean testWithDb){
  String errStr=null;
  CoverageItem item=getNavigateButton2getTextLine3CoverageItem(coveragePackage);
  if (item == null) {
    errStr="String_Node_Str";
  }
 else {
    item.setCoverageMethod(CoverageOptionManager.Deactivated_Code);
  }
  item=getNavigateButton2getImageLine3CoverageItem(coveragePackage);
  if (item == null) {
    errStr+="String_Node_Str";
  }
 else {
    item.setCoverageMethod(CoverageOptionManager.Deactivated_Code);
    item.setRationale("String_Node_Str");
  }
  if (Strings.isValid(errStr)) {
    return new Result(errStr);
  }
  if (testWithDb) {
    OseeCoveragePackageStore packageStore=new OseeCoveragePackageStore(coveragePackage,CoverageBranches.COVERAGE_TEST_BRANCH);
    packageStore.save(coveragePackage.getName(),coveragePackage.getCoverageOptionManager());
  }
  return Result.TrueResult;
}
Program: 97494
Project: 97494
Buggy source:
@Override public void run() throws OseeCoreException {
  Branch coverageBranch=BranchManager.createTopLevelBranch(CoverageBranches.SAW_Bld_1);
  OseeSystemArtifacts.getDefaultHierarchyRootArtifact(coverageBranch);
}

Fixed version (ground truth):
@Override public void run() throws OseeCoreException {
  Branch coverageBranch=BranchManager.createTopLevelBranch(CoverageBranches.COVERAGE_TEST_BRANCH);
  OseeSystemArtifacts.getDefaultHierarchyRootArtifact(coverageBranch);
}
Program: 97495
Project: 97495
Buggy source:
@After public void cleanUpTestArtifact(){
  BranchManager.deleteBranch(testBranch);
}

Fixed version (ground truth):
@After public void cleanUpTestArtifact(){
  BranchManager.deleteBranch(testTopBranch);
  BranchManager.deleteBranch(testWorkingBranch);
}
Program: 97496
Project: 97496
Buggy source:
@Test public void testStore() throws OseeCoreException {
  ArtifactTestUnitStore store=new ArtifactTestUnitStore(testBranch);
  TestUnitCache tc=new TestUnitCache(store);
  CoverageItem ci=createCoverageItem(tc);
  ci.addTestUnitName("String_Node_Str");
  ci.addTestUnitName("String_Node_Str");
  store.store(tc);
  SkynetTransaction transaction=TransactionManager.createTransaction(testBranch,getClass().getSimpleName());
  Artifact testArtifact=ArtifactQuery.getOrCreate(ArtifactTestUnitStore.COVERAGE_GUID,null,CoreArtifactTypes.GeneralData,testBranch);
  String actual=testArtifact.getSoleAttributeValueAsString(CoreAttributeTypes.GeneralStringData,"String_Node_Str");
  String expected=testInputData + "String_Node_Str";
  Assert.assertEquals(expected,actual);
  testArtifact.persist(transaction);
  transaction.execute();
}

Fixed version (ground truth):
@Test public void testStore() throws OseeCoreException {
  Artifact testArtifact=ArtifactQuery.getOrCreate(coverageTestGuid,null,CoverageArtifactTypes.CoveragePackage,testWorkingBranch);
  testArtifact.setSoleAttributeFromString(CoverageAttributeTypes.UnitTestTable,testInputDataCoverageArtifact);
  ArtifactTestUnitStore store=new ArtifactTestUnitStore(testArtifact,readOnlyTestUnitNames);
  TestUnitCache tc=new TestUnitCache(store);
  CoverageItem ci=createCoverageItem(tc);
  ci.addTestUnitName("String_Node_Str");
  SkynetTransaction transaction=TransactionManager.createTransaction(testWorkingBranch,getClass().getSimpleName());
  store.store(tc,transaction);
  String actual=testArtifact.getSoleAttributeValueAsString(CoverageAttributeTypes.UnitTestTable,"String_Node_Str");
  String expected="String_Node_Str" + testInputDataCoverageArtifact;
  Assert.assertEquals(expected,actual);
  testArtifact.persist(transaction);
  transaction.execute();
}
Program: 97497
Project: 97497
Buggy source:
@Before public void createTestArtifact() throws OseeCoreException {
  testBranch=BranchManager.createTopLevelBranch("String_Node_Str");
  Artifact testArtifact=ArtifactQuery.getOrCreate(ArtifactTestUnitStore.COVERAGE_GUID,null,CoreArtifactTypes.GeneralData,testBranch);
  testArtifact.setSoleAttributeFromString(CoreAttributeTypes.GeneralStringData,testInputData);
}

Fixed version (ground truth):
@Before public void createTestArtifact() throws OseeCoreException {
  testTopBranch=BranchManager.createTopLevelBranch("String_Node_Str");
  testWorkingBranch=BranchManager.createWorkingBranch(CoverageTestUtil.getTestBranch(),"String_Node_Str");
  readOnlyTestUnitNames=ArtifactQuery.getOrCreate(ArtifactTestUnitStore.READ_ONLY_GUID,null,CoreArtifactTypes.GeneralData,testTopBranch);
  readOnlyTestUnitNames.setSoleAttributeFromString(CoreAttributeTypes.GeneralStringData,testInputDataReadOnlyList);
}
Program: 97498
Project: 97498
Buggy source:
@Test public void testLoad() throws OseeCoreException {
  ArtifactTestUnitStore store=new ArtifactTestUnitStore(testBranch);
  TestUnitCache tc=new TestUnitCache(store);
  store.load(tc);
  StringBuilder actual=new StringBuilder();
  boolean firstTime=true;
  for (  Entry<Integer,String> entry : tc.getAllCachedTestUnitEntries()) {
    if (!firstTime) {
      actual.append("String_Node_Str");
    }
    actual.append(Integer.toString(entry.getKey()));
    actual.append("String_Node_Str");
    actual.append(entry.getValue());
    firstTime=false;
  }
  Assert.assertEquals(testInputData,actual.toString());
}

Fixed version (ground truth):
@Test public void testLoad() throws OseeCoreException {
  ArtifactTestUnitStore store=new ArtifactTestUnitStore(null,readOnlyTestUnitNames);
  TestUnitCache tc=new TestUnitCache(store);
  store.load(tc);
  StringBuilder actual=new StringBuilder();
  boolean firstTime=true;
  for (  Entry<Integer,String> entry : tc.getAllCachedTestUnitEntries()) {
    if (!firstTime) {
      actual.append("String_Node_Str");
    }
    actual.append(Integer.toString(entry.getKey()));
    actual.append("String_Node_Str");
    actual.append(entry.getValue());
    firstTime=false;
  }
  Assert.assertEquals(testInputDataReadOnlyList,actual.toString());
}
Program: 97499
Project: 97499
Buggy source:
/** 
 * Test method for  {@link org.eclipse.osee.coverage.model.CoverageItem#delete(org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction,coverageEvent,boolean)}.
 */
@Test public void testDelete() throws OseeCoreException {
  Artifact artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).getArtifact(false);
  Assert.assertNotNull(artifact);
  SkynetTransaction transaction=TransactionManager.createTransaction(CoverageTestUtil.getTestBranch(),"String_Node_Str");
  CoveragePackageEvent coverageEvent=new CoveragePackageEvent("String_Node_Str",GUID.create(),CoverageEventType.Deleted,GUID.create());
  new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).delete(transaction,coverageEvent,false);
  transaction.execute();
  artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).getArtifact(false);
  Assert.assertNull(artifact);
  Assert.assertEquals(0,CoverageTestUtil.getAllCoverageArtifacts().size());
  Assert.assertEquals(1,coverageEvent.getCoverages().size());
  Assert.assertEquals(CoverageEventType.Deleted,coverageEvent.getCoverages().iterator().next().getEventType());
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.eclipse.osee.coverage.model.CoverageItem#delete(org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction,coverageEvent,boolean)}.
 */
@Test public void testDelete() throws OseeCoreException {
  Artifact artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).getArtifact(false);
  Assert.assertNotNull(artifact);
  SkynetTransaction transaction=TransactionManager.createTransaction(CoverageTestUtil.getTestBranch(),"String_Node_Str");
  CoveragePackageEvent coverageEvent=new CoveragePackageEvent("String_Node_Str",GUID.create(),CoverageEventType.Deleted,GUID.create());
  new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).delete(transaction,coverageEvent,false);
  transaction.execute();
  artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).getArtifact(false);
  Assert.assertNull(artifact);
  Assert.assertEquals(0,CoverageTestUtil.getAllCoverageArtifacts().size());
  Assert.assertEquals(1,coverageEvent.getCoverages().size());
  Assert.assertEquals(CoverageEventType.Deleted,coverageEvent.getCoverages().iterator().next().getEventType());
}
Program: 97500
Project: 97500
Buggy source:
@Before public void testSetup() throws OseeCoreException {
  if (!initOnce) {
    initOnce=true;
    CoverageUtil.setNavigatorSelectedBranch(CoverageTestUtil.getTestBranch());
    CoverageTestUtil.cleanupCoverageTests();
    Assert.assertEquals(0,CoverageTestUtil.getAllCoverageArtifacts().size());
    parentCu=CoverageUnitFactory.createCoverageUnit(null,"String_Node_Str","String_Node_Str",null);
    parentGuid=parentCu.getGuid();
    ITestUnitStore testUnitStore=mock(ITestUnitStore.class);
    testUnitCache=new TestUnitCache(testUnitStore);
    ci=new CoverageItem(parentCu,CoverageOptionManager.Deactivated_Code,"String_Node_Str");
    ci.setTestUnitProvider(testUnitCache);
    for (int x=0; x < 10; x++) {
      ci.addTestUnitName("String_Node_Str" + x);
    }
    ci.setRationale("String_Node_Str");
    ci.setName("String_Node_Str");
    guid=ci.getGuid();
  }
}

Fixed version (ground truth):
@Before public void testSetup() throws OseeCoreException {
  if (!initOnce) {
    initOnce=true;
    CoverageUtil.setNavigatorSelectedBranch(CoverageTestUtil.getTestBranch());
    CoverageTestUtil.cleanupCoverageTests();
    Assert.assertEquals(0,CoverageTestUtil.getAllCoverageArtifacts().size());
    readOnlyTestUnitNames=ArtifactQuery.getOrCreate(ArtifactTestUnitStore.READ_ONLY_GUID,null,CoreArtifactTypes.GeneralData,CoverageTestUtil.getTestBranch());
    readOnlyTestUnitNames.setSoleAttributeFromString(CoreAttributeTypes.GeneralStringData,"String_Node_Str");
    parentCu=CoverageUnitFactory.createCoverageUnit(null,"String_Node_Str","String_Node_Str",null);
    parentGuid=parentCu.getGuid();
    ArtifactTestUnitStore testUnitStore=new ArtifactTestUnitStore(null,readOnlyTestUnitNames);
    testUnitCache=new TestUnitCache(testUnitStore);
    ci=new CoverageItem(parentCu,CoverageOptionManager.Deactivated_Code,"String_Node_Str");
    ci.setTestUnitProvider(testUnitCache);
    for (int x=0; x < 10; x++) {
      ci.addTestUnitName("String_Node_Str" + x);
    }
    ci.setRationale("String_Node_Str");
    ci.setName("String_Node_Str");
    guid=ci.getGuid();
  }
}
Program: 97501
Project: 97501
Buggy source:
/** 
 * Test method for   {@link org.eclipse.osee.coverage.model.CoverageItem#asArtifact(boolean)}.
 */
@Test public void testGetArtifact() throws OseeCoreException {
  try {
    ArtifactQuery.getArtifactFromId(parentGuid,CoverageTestUtil.getTestBranch());
    Assert.fail("String_Node_Str");
  }
 catch (  ArtifactDoesNotExist ex) {
  }
  Artifact artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).getArtifact(false);
  Assert.assertNull("String_Node_Str",artifact);
  artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).getArtifact(true);
  CoverageTestUtil.registerAsTestArtifact(artifact);
  artifact.persist(getClass().getSimpleName());
  Assert.assertNotNull("String_Node_Str",artifact);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.osee.coverage.model.CoverageItem#asArtifact(boolean)}.
 */
@Test public void testGetArtifact() throws OseeCoreException {
  try {
    ArtifactQuery.getArtifactFromId(parentGuid,CoverageTestUtil.getTestBranch());
    Assert.fail("String_Node_Str");
  }
 catch (  ArtifactDoesNotExist ex) {
  }
  Artifact artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).getArtifact(false);
  Assert.assertNull("String_Node_Str",artifact);
  artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).getArtifact(true);
  CoverageTestUtil.registerAsTestArtifact(artifact);
  artifact.persist(getClass().getSimpleName());
  Assert.assertNotNull("String_Node_Str",artifact);
}
Program: 97502
Project: 97502
Buggy source:
/** 
 * Test method for  {@link org.eclipse.osee.coverage.model.CoverageItem#save(SkynetTransaction,String,CoverageOptionManager)}
 */
@Test public void testSave() throws OseeCoreException {
  Assert.assertEquals(10,ci.getTestUnits().size());
  Artifact artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).getArtifact(true);
  Assert.assertNotNull(artifact);
  SkynetTransaction transaction=TransactionManager.createTransaction(CoverageTestUtil.getTestBranch(),"String_Node_Str");
  String coverageGuid=GUID.create();
  String coverageName="String_Node_Str";
  CoveragePackageEvent coverageEvent=new CoveragePackageEvent(coverageName,coverageGuid,CoverageEventType.Modified,GUID.create());
  new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch()).save(transaction,coverageEvent,CoverageOptionManagerDefault.instance());
  artifact.persist(transaction);
  transaction.execute();
  Assert.assertEquals(coverageGuid,coverageEvent.getPackage().getGuid());
  Assert.assertEquals(coverageName,coverageEvent.getPackage().getName());
  Assert.assertEquals(CoverageEventType.Modified,coverageEvent.getPackage().getEventType());
  Assert.assertEquals(2,coverageEvent.getCoverages().size());
  Assert.assertEquals(CoverageEventType.Added,coverageEvent.getCoverages().iterator().next().getEventType());
  Assert.assertEquals(10,ci.getTestUnits().size());
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.eclipse.osee.coverage.model.CoverageItem#save(SkynetTransaction,String,CoverageOptionManager)}
 */
@Test public void testSave() throws OseeCoreException {
  Assert.assertEquals(10,ci.getTestUnits().size());
  Artifact artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).getArtifact(true);
  Assert.assertNotNull(artifact);
  SkynetTransaction transaction=TransactionManager.createTransaction(CoverageTestUtil.getTestBranch(),"String_Node_Str");
  String coverageGuid=GUID.create();
  String coverageName="String_Node_Str";
  CoveragePackageEvent coverageEvent=new CoveragePackageEvent(coverageName,coverageGuid,CoverageEventType.Modified,GUID.create());
  new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),readOnlyTestUnitNames).save(transaction,coverageEvent,CoverageOptionManagerDefault.instance());
  artifact.persist(transaction);
  transaction.execute();
  Assert.assertEquals(coverageGuid,coverageEvent.getPackage().getGuid());
  Assert.assertEquals(coverageName,coverageEvent.getPackage().getName());
  Assert.assertEquals(CoverageEventType.Modified,coverageEvent.getPackage().getEventType());
  Assert.assertEquals(2,coverageEvent.getCoverages().size());
  Assert.assertEquals(CoverageEventType.Added,coverageEvent.getCoverages().iterator().next().getEventType());
  Assert.assertEquals(10,ci.getTestUnits().size());
}
Program: 97503
Project: 97503
Buggy source:
public static void cleanupCoverageTests() throws OseeCoreException {
  try {
    Collection<? extends Artifact> allCoverageArtifacts=getAllCoverageArtifacts();
    IOperation op=new PurgeArtifacts(allCoverageArtifacts);
    Operations.executeWorkAndCheckStatus(op);
  }
 catch (  ArtifactDoesNotExist ex) {
  }
}

Fixed version (ground truth):
public static void cleanupCoverageTests() throws OseeCoreException {
  try {
    for (    Artifact art : ArtifactCache.getDirtyArtifacts()) {
      ArtifactCache.deCache(art);
    }
    Collection<? extends Artifact> allCoverageArtifacts=getAllCoverageArtifacts();
    IOperation op=new PurgeArtifacts(allCoverageArtifacts);
    Operations.executeWorkAndCheckStatus(op);
  }
 catch (  ArtifactDoesNotExist ex) {
  }
}
Program: 97504
Project: 97504
Buggy source:
public static IOseeBranch getTestBranch(){
  return CoverageBranches.SAW_Bld_1;
}

Fixed version (ground truth):
public static IOseeBranch getTestBranch(){
  return CoverageBranches.COVERAGE_TEST_BRANCH;
}
Program: 97505
Project: 97505
Buggy source:
public void setMetrics(IStateToken state,double hours,int percentComplete,boolean logMetrics,IAtsUser user,Date date) throws OseeCoreException {
  getStateProvider().setHoursSpent(state.getName(),hours);
  getStateProvider().setPercentComplete(state.getName(),percentComplete);
  if (logMetrics) {
    logMetrics(awa.getStateMgr().getCurrentState(),AtsUsersClient.getUser(),new Date());
  }
  writeToArtifact();
}

Fixed version (ground truth):
/** 
 * Set metrics and log if changed
 */
public void setMetrics(IStateToken state,double hours,int percentComplete,boolean logMetrics,IAtsUser user,Date date) throws OseeCoreException {
  boolean changed=setMetricsIfChanged(state,hours,percentComplete);
  if (changed) {
    if (logMetrics) {
      logMetrics(awa.getStateMgr().getCurrentState(),AtsUsersClient.getUser(),new Date());
    }
    writeToArtifact();
  }
}
Program: 97506
Project: 97506
Buggy source:
@Override public Boolean call() throws Exception {
  for (  String fileToImport : importFiles) {
    console.writeln("String_Node_Str",fileToImport);
    URI uriToCheck=new URI("String_Node_Str" + fileToImport);
    orcsBranch.checkBranchExchangeIntegrity(uriToCheck);
  }
  return Boolean.TRUE;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  for (  String fileToImport : importFiles) {
    console.writeln("String_Node_Str",fileToImport);
    URI uriToCheck=new URI("String_Node_Str" + fileToImport);
    Callable<URI> callable=orcsBranch.checkBranchExchangeIntegrity(uriToCheck);
    callable.call();
    checkForCancelled();
  }
  return Boolean.TRUE;
}
Program: 97507
Project: 97507
Buggy source:
@Override public Boolean call() throws Exception {
  if (importFiles.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  List<IOseeBranch> branches=new LinkedList<IOseeBranch>();
  for (  String branchIdString : branchIds) {
    IOseeBranch branch=branchCache.getById(Integer.parseInt(branchIdString));
    branches.add(branch);
  }
  for (  String fileToImport : importFiles) {
    URI uri=new URI("String_Node_Str" + fileToImport);
    console.writeln("String_Node_Str",uri);
    orcsBranch.importBranch(uri,branches,options);
  }
  return Boolean.TRUE;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  if (importFiles.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  List<IOseeBranch> branches=new LinkedList<IOseeBranch>();
  for (  String branchIdString : branchIds) {
    IOseeBranch branch=branchCache.getById(Integer.parseInt(branchIdString));
    branches.add(branch);
  }
  for (  String fileToImport : importFiles) {
    URI uri=new URI("String_Node_Str" + fileToImport);
    console.writeln("String_Node_Str",uri);
    Callable<URI> callable=orcsBranch.importBranch(uri,branches,options);
    callable.call();
    checkForCancelled();
  }
  return Boolean.TRUE;
}
Program: 97508
Project: 97508
Buggy source:
public Collection<? extends IAtsUser> getToAssignees() throws OseeCoreException ;

Fixed version (ground truth):
public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException ;
Program: 97509
Project: 97509
Buggy source:
@Override public Collection<? extends IAtsUser> getToAssignees(){
  return toAssignees;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException {
  return toAssignees;
}
Program: 97511
Project: 97511
Buggy source:
public void isTransitionValidForExtensions(TransitionResults results,AbstractWorkflowArtifact awa,IAtsStateDefinition fromStateDef,IAtsStateDefinition toStateDef){
  for (  ITransitionListener listener : TransitionListeners.getListeners()) {
    try {
      listener.transitioning(results,awa,fromStateDef,toStateDef,helper.getToAssignees());
      if (results.isCancelled() || !results.isEmpty()) {
        continue;
      }
    }
 catch (    OseeCoreException ex) {
      results.addResult(awa,new TransitionResult(String.format("String_Node_Str",ex.getMessage(),helper.getName()),ex));
    }
  }
  if (results.isEmpty()) {
    for (    ITransitionListener listener : TransitionListeners.getListeners()) {
      try {
        listener.transitioning(results,awa,fromStateDef,toStateDef,helper.getToAssignees());
        if (results.isCancelled() || !results.isEmpty()) {
          continue;
        }
      }
 catch (      OseeCoreException ex) {
        results.addResult(awa,new TransitionResult(String.format("String_Node_Str",ex.getMessage(),helper.getName()),ex));
      }
    }
  }
}

Fixed version (ground truth):
public void isTransitionValidForExtensions(TransitionResults results,AbstractWorkflowArtifact awa,IAtsStateDefinition fromStateDef,IAtsStateDefinition toStateDef){
  for (  ITransitionListener listener : TransitionListeners.getListeners()) {
    try {
      listener.transitioning(results,awa,fromStateDef,toStateDef,getToAssignees(awa,toStateDef));
      if (results.isCancelled() || !results.isEmpty()) {
        continue;
      }
    }
 catch (    OseeCoreException ex) {
      results.addResult(awa,new TransitionResult(String.format("String_Node_Str",ex.getMessage(),helper.getName()),ex));
    }
  }
  awasToAssignees.remove(awa);
  if (results.isEmpty()) {
    for (    ITransitionListener listener : TransitionListeners.getListeners()) {
      try {
        listener.transitioning(results,awa,fromStateDef,toStateDef,getToAssignees(awa,toStateDef));
        if (results.isCancelled() || !results.isEmpty()) {
          continue;
        }
      }
 catch (      OseeCoreException ex) {
        results.addResult(awa,new TransitionResult(String.format("String_Node_Str",ex.getMessage(),helper.getName()),ex));
      }
    }
  }
}
Program: 97513
Project: 97513
Buggy source:
@Override public Collection<? extends IAtsUser> getToAssignees() throws OseeCoreException {
  return awa.getTransitionAssignees();
}

Fixed version (ground truth):
@Override public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException {
  return awa.getTransitionAssignees();
}
Program: 97515
Project: 97515
Buggy source:
@Override public Collection<? extends IAtsUser> getToAssignees(){
  return Collections.emptyList();
}

Fixed version (ground truth):
@Override public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException {
  return awa.getAssignees();
}
Program: 97516
Project: 97516
Buggy source:
private void runGeneralXColTest(int expected,boolean isErrorCheck,IAttributeType attributeTypeToDelete,boolean testTaskTab) throws OseeCoreException {
  List<Artifact> arts=new ArrayList<Artifact>();
  List<Artifact> taskArts=new ArrayList<Artifact>();
  List<XViewerColumn> columns=getXViewer().getCustomizeMgr().getCurrentTableColumns();
  ITableLabelProvider labelProv=(ITableLabelProvider)getXViewer().getLabelProvider();
  TreeItem[] treeItem=getXViewer().getTree().getItems();
  NavigateTestUtil.getAllArtifactChildren(treeItem,arts);
  NavigateTestUtil.testExpectedVersusActual("String_Node_Str",expected,arts.size());
  if (testTaskTab) {
    getXViewer().expandAll();
    arts.clear();
    this.getAllTreeItems(getXViewer().getTree().getItems(),taskArts);
    TaskEditor.open(new TaskEditorSimpleProvider("String_Node_Str",getXViewer().getSelectedTaskArtifacts()));
    handleTableCustomization();
    columns=getXViewer().getCustomizeMgr().getCurrentTableColumns();
    verifyXColumns(labelProv,arts,columns);
  }
 else   if (isErrorCheck) {
    verifyXColumnsHasErrors(labelProv,arts,columns,attributeTypeToDelete);
  }
 else {
    verifyXColumns(labelProv,arts,columns);
  }
}

Fixed version (ground truth):
private void runGeneralXColTest(int expected,boolean isErrorCheck,IAttributeType attributeTypeToDelete,boolean testTaskTab) throws OseeCoreException {
  List<Artifact> arts=new ArrayList<Artifact>();
  List<Artifact> taskArts=new ArrayList<Artifact>();
  List<XViewerColumn> columns=getXViewer().getCustomizeMgr().getCurrentTableColumns();
  ITableLabelProvider labelProv=(ITableLabelProvider)getXViewer().getLabelProvider();
  TreeItem[] treeItem=getXViewer().getTree().getItems();
  NavigateTestUtil.getAllArtifactChildren(treeItem,arts);
  NavigateTestUtil.testExpectedVersusActual("String_Node_Str",expected,arts.size());
  if (testTaskTab) {
    getXViewer().expandAll();
    arts.clear();
    this.getAllTreeItems(getXViewer().getTree().getItems(),taskArts);
    TaskEditor.open(new TaskEditorSimpleProvider("String_Node_Str",getXViewer().getSelectedTaskArtifacts()));
    handleTableCustomization();
    getXViewer().expandAll();
    columns=getXViewer().getCustomizeMgr().getCurrentTableColumns();
    verifyXColumns(labelProv,arts,columns);
  }
 else   if (isErrorCheck) {
    verifyXColumnsHasErrors(labelProv,arts,columns,attributeTypeToDelete);
  }
 else {
    verifyXColumns(labelProv,arts,columns);
  }
}
Program: 97517
Project: 97517
Buggy source:
private void deleteAttributesForXColErrorTest(Collection<Artifact> arts,IAttributeType attributeTypeToDelete) throws Exception {
  Map<Artifact,Object> attributeValues=new HashMap<Artifact,Object>();
  getXViewer().expandAll();
  handleTableCustomization();
  SkynetTransaction transaction=TransactionManager.createTransaction(AtsUtil.getAtsBranch(),"String_Node_Str");
  for (  Artifact art : arts) {
    attributeValues.put(art,art.getSoleAttributeValue(attributeTypeToDelete));
    art.deleteAttribute(attributeTypeToDelete,art.getSoleAttributeValue(attributeTypeToDelete));
    art.persist(transaction);
  }
  transaction.execute();
  try {
    runGeneralXColTest(20,true,attributeTypeToDelete,false);
  }
  finally {
    transaction=TransactionManager.createTransaction(AtsUtil.getAtsBranch(),"String_Node_Str");
    for (    Artifact art : arts) {
      art.setSoleAttributeValue(attributeTypeToDelete,attributeValues.get(art));
      art.persist(transaction);
    }
    transaction.execute();
  }
}

Fixed version (ground truth):
private void deleteAttributesForXColErrorTest(Collection<Artifact> arts,IAttributeType attributeTypeToDelete) throws Exception {
  Map<Artifact,Object> attributeValues=new HashMap<Artifact,Object>();
  handleTableCustomization();
  getXViewer().expandAll();
  SkynetTransaction transaction=TransactionManager.createTransaction(AtsUtil.getAtsBranch(),"String_Node_Str");
  for (  Artifact art : arts) {
    attributeValues.put(art,art.getSoleAttributeValue(attributeTypeToDelete));
    art.deleteAttribute(attributeTypeToDelete,art.getSoleAttributeValue(attributeTypeToDelete));
    art.persist(transaction);
  }
  transaction.execute();
  try {
    runGeneralXColTest(20,true,attributeTypeToDelete,false);
  }
  finally {
    transaction=TransactionManager.createTransaction(AtsUtil.getAtsBranch(),"String_Node_Str");
    for (    Artifact art : arts) {
      art.setSoleAttributeValue(attributeTypeToDelete,attributeValues.get(art));
      art.persist(transaction);
    }
    transaction.execute();
  }
}
Program: 97519
Project: 97519
Buggy source:
private void saveAndCloseViews(){
  PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
    @Override public void run(){
      saveAndCloseManagedViews();
    }
  }
);
}

Fixed version (ground truth):
private void saveAndCloseViews(){
  PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
    @Override public void run(){
      saveAndCloseManagedViews(determineManagedViews(),true);
    }
  }
);
}
Program: 97520
Project: 97520
Buggy source:
public WorkspaceBundleLoadCoordinator(File temporaryBundleLocationFolder){
  bundlesToCheck=new HashSet<String>();
  this.temporaryBundleLocationFolder=temporaryBundleLocationFolder;
  if (!temporaryBundleLocationFolder.exists()) {
    if (!temporaryBundleLocationFolder.mkdirs()) {
      this.temporaryBundleLocationFolder=makeTempFolder();
    }
  }
 else   if (temporaryBundleLocationFolder.exists() && !temporaryBundleLocationFolder.isDirectory()) {
    this.temporaryBundleLocationFolder=makeTempFolder();
  }
 else   if (temporaryBundleLocationFolder.exists()) {
    cleanOutDirectory();
  }
  Bundle bundle=FrameworkUtil.getBundle(getClass());
  for (  Bundle findit : bundle.getBundleContext().getBundles()) {
    wiring=findit.adapt(FrameworkWiring.class);
    if (wiring != null) {
      break;
    }
  }
}

Fixed version (ground truth):
public WorkspaceBundleLoadCoordinator(File temporaryBundleLocationFolder){
  bundlesToCheck=new HashSet<String>();
  this.temporaryBundleLocationFolder=temporaryBundleLocationFolder;
  if (!temporaryBundleLocationFolder.exists()) {
    if (!temporaryBundleLocationFolder.mkdirs()) {
      this.temporaryBundleLocationFolder=makeTempFolder();
    }
  }
 else   if (temporaryBundleLocationFolder.exists() && !temporaryBundleLocationFolder.isDirectory()) {
    this.temporaryBundleLocationFolder=makeTempFolder();
  }
 else   if (temporaryBundleLocationFolder.exists()) {
    cleanOutDirectory();
  }
  Bundle bundle=FrameworkUtil.getBundle(getClass());
  for (  Bundle findit : bundle.getBundleContext().getBundles()) {
    wiring=findit.adapt(FrameworkWiring.class);
    if (wiring != null) {
      break;
    }
  }
  Thread th=new Thread(new Runnable(){
    @Override public void run(){
      int lastSize=0;
      while (true) {
        try {
          Thread.sleep(5000);
        }
 catch (        InterruptedException e) {
        }
        if (lastSize == bundlesToCheck.size()) {
          if (lastSize != 0) {
            if (bundlesToCheck.size() > 0) {
              lastSize=0;
              Jobs.runInJob(new RefreshWorkspaceBundles(),false);
              try {
                Thread.sleep(1000 * 30);
              }
 catch (              InterruptedException e) {
              }
            }
          }
        }
 else {
          lastSize=bundlesToCheck.size();
        }
      }
    }
  }
);
  th.setName("String_Node_Str");
  th.setDaemon(true);
  th.start();
}
Program: 97521
Project: 97521
Buggy source:
private void forceViewRegistryReload(IWorkbench workbench,IViewRegistry registry){
  try {
    Method[] methods=registry.getClass().getDeclaredMethods();
    Method method=null;
    for (    Method m : methods) {
      if (m.getName().equals("String_Node_Str")) {
        method=m;
        break;
      }
    }
    if (method != null) {
      boolean access=method.isAccessible();
      method.setAccessible(true);
      try {
        method.invoke(registry);
      }
  finally {
        method.setAccessible(access);
      }
    }
  }
 catch (  Throwable th) {
    OseeLog.log(this.getClass(),Level.SEVERE,th);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) private void forceViewRegistryReload(IWorkbench workbench,IViewRegistry registry){
  try {
    Field field1=registry.getClass().getDeclaredField("String_Node_Str");
    Field field2=registry.getClass().getDeclaredField("String_Node_Str");
    Field field3=registry.getClass().getDeclaredField("String_Node_Str");
    field1.setAccessible(true);
    field2.setAccessible(true);
    field3.setAccessible(true);
    ((Map)field1.get(registry)).clear();
    ((List)field2.get(registry)).clear();
    ((Map)field3.get(registry)).clear();
    field1.setAccessible(false);
    field2.setAccessible(false);
    field3.setAccessible(false);
    Method[] methods=registry.getClass().getDeclaredMethods();
    Method method=null;
    for (    Method m : methods) {
      if (m.getName().equals("String_Node_Str")) {
        method=m;
        break;
      }
    }
    if (method != null) {
      boolean access=method.isAccessible();
      method.setAccessible(true);
      try {
        method.invoke(registry);
      }
  finally {
        method.setAccessible(access);
      }
    }
  }
 catch (  Throwable th) {
    OseeLog.log(this.getClass(),Level.SEVERE,th);
  }
}