nus-yam/ex-repair huggingface dataset:
Program: 97342
Project: 97342
Buggy source:
@Override public void performDrop(final DropTargetEvent event){
  final ArtifactData artData=ArtifactTransfer.getInstance().nativeToJava(event.currentDataType);
  final List<Artifact> droppedArtifacts=Arrays.asList(artData.getArtifacts());
  Collections.reverse(droppedArtifacts);
  final Artifact dropTarget=getSelectedArtifact(event);
  if (ArtifactTransfer.getInstance().isSupportedType(event.currentDataType)) {
    try {
      Collections.reverse(droppedArtifacts);
      List<Artifact> members=goalArtifact.getMembers();
      for (      Artifact dropped : droppedArtifacts) {
        if (!members.contains(dropped)) {
          goalArtifact.addMember(dropped);
          int index=isFeedbackAfter ? members.indexOf(dropTarget) + 1 : members.indexOf(dropTarget);
          worldComposite.insert(dropped,index);
          worldComposite.update();
        }
        if (dropTarget != null) {
          goalArtifact.setRelationOrder(AtsRelationTypes.Goal_Member,dropTarget,isFeedbackAfter,dropped);
        }
      }
      goalArtifact.persist(SMAMembersTab.class.getSimpleName());
      worldComposite.getXViewer().refresh(goalArtifact);
      worldComposite.getXViewer().update(dropTarget,null);
    }
 catch (    OseeCoreException ex) {
      OseeLog.log(Activator.class,Level.WARNING,Lib.exceptionToString(ex));
    }
  }
}

Fixed version (ground truth):
@Override public void performDrop(final DropTargetEvent event){
  final ArtifactData artData=ArtifactTransfer.getInstance().nativeToJava(event.currentDataType);
  final List<Artifact> droppedArtifacts=Arrays.asList(artData.getArtifacts());
  Collections.reverse(droppedArtifacts);
  final Artifact dropTarget=getSelectedArtifact(event);
  try {
    if (isDropValid() && ArtifactTransfer.getInstance().isSupportedType(event.currentDataType)) {
      Collections.reverse(droppedArtifacts);
      List<Artifact> members=goalArtifact.getMembers();
      for (      Artifact dropped : droppedArtifacts) {
        if (!members.contains(dropped)) {
          goalArtifact.addMember(dropped);
          int index=isFeedbackAfter ? members.indexOf(dropTarget) + 1 : members.indexOf(dropTarget);
          worldComposite.insert(dropped,index);
          worldComposite.update();
        }
        if (dropTarget != null) {
          goalArtifact.setRelationOrder(AtsRelationTypes.Goal_Member,dropTarget,isFeedbackAfter,dropped);
        }
      }
      goalArtifact.persist(SMAMembersTab.class.getSimpleName());
      worldComposite.getXViewer().refresh(goalArtifact);
      worldComposite.getXViewer().update(dropTarget,null);
    }
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.WARNING,Lib.exceptionToString(ex));
  }
}
Program: 97343
Project: 97343
Buggy source:
/** 
 * @return true if created; false if skipped
 */
private boolean createMembersBody(){
  if (!Widgets.isAccessible(worldComposite)) {
    worldComposite=new WorldComposite("String_Node_Str",editor,new GoalXViewerFactory((GoalArtifact)editor.getAwa()),bodyComp,SWT.BORDER,false);
    new GoalDragAndDrop(worldComposite,SMAEditor.EDITOR_ID);
    WorldLabelProvider labelProvider=(WorldLabelProvider)worldComposite.getXViewer().getLabelProvider();
    labelProvider.setParentGoal((GoalArtifact)editor.getAwa());
    worldComposite.getWorldXViewer().addMenuActionProvider(this);
    getSite().setSelectionProvider(worldComposite.getWorldXViewer());
    GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
    gd.widthHint=100;
    gd.heightHint=100;
    worldComposite.setLayoutData(gd);
    reload();
    createActions();
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return true if created; false if skipped
 */
private boolean createMembersBody(){
  if (!Widgets.isAccessible(worldComposite)) {
    worldComposite=new WorldComposite("String_Node_Str",editor,new GoalXViewerFactory((GoalArtifact)editor.getAwa()),bodyComp,SWT.BORDER);
    new GoalDragAndDrop(worldComposite,SMAEditor.EDITOR_ID);
    WorldLabelProvider labelProvider=(WorldLabelProvider)worldComposite.getXViewer().getLabelProvider();
    labelProvider.setParentGoal((GoalArtifact)editor.getAwa());
    worldComposite.getWorldXViewer().addMenuActionProvider(this);
    getSite().setSelectionProvider(worldComposite.getWorldXViewer());
    GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
    gd.widthHint=100;
    gd.heightHint=100;
    worldComposite.setLayoutData(gd);
    reload();
    createActions();
    return true;
  }
  return false;
}
Program: 97344
Project: 97344
Buggy source:
private void refreshToolbar(){
  IToolBarManager toolBarMgr=scrolledForm.getToolBarManager();
  toolBarMgr.removeAll();
  toolBarMgr.add(getWorldXViewer().getCustomizeAction());
  toolBarMgr.add(new RefreshAction(worldComposite));
  scrolledForm.updateToolBar();
}

Fixed version (ground truth):
private void refreshToolbar(){
  IToolBarManager toolBarMgr=scrolledForm.getToolBarManager();
  toolBarMgr.removeAll();
  toolBarMgr.add(new OpenNewAtsWorldEditorSelectedAction(worldComposite));
  toolBarMgr.add(getWorldXViewer().getCustomizeAction());
  toolBarMgr.add(new RefreshAction(worldComposite));
  scrolledForm.updateToolBar();
}
Program: 97345
Project: 97345
Buggy source:
public GoalDragAndDrop(WorldComposite worldComposite,String viewId){
  super(worldComposite,viewId);
}

Fixed version (ground truth):
public GoalDragAndDrop(WorldComposite worldComposite,String viewId){
  super(worldComposite.getXViewer().getTree(),viewId);
  this.worldComposite=worldComposite;
}
Program: 97346
Project: 97346
Buggy source:
public WorldComposite(String id,final IWorldEditor worldEditor,IXViewerFactory xViewerFactory,Composite parent,int style,boolean createDragAndDrop){
  super(parent,style);
  this.id=id;
  this.iWorldEditor=worldEditor;
  setLayout(new GridLayout(1,true));
  setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite mainComp=new Composite(this,SWT.NONE);
  mainComp.setLayout(ALayout.getZeroMarginLayout());
  mainComp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  if (!DbConnectionExceptionComposite.dbConnectionIsOk(this)) {
    worldXViewer=null;
    return;
  }
  worldXViewer=new WorldXViewer(mainComp,SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION,xViewerFactory != null ? xViewerFactory : new WorldXViewerFactory(),null);
  worldXViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  worldXViewer.setContentProvider(new WorldContentProvider(worldXViewer));
  worldXViewer.setLabelProvider(new WorldLabelProvider(worldXViewer));
  if (createDragAndDrop) {
    new WorldViewDragAndDrop(this,WorldEditor.EDITOR_ID);
  }
  setContent(mainComp);
  setExpandHorizontal(true);
  setExpandVertical(true);
  layout();
  WorldXViewerEventManager.add(this);
}

Fixed version (ground truth):
public WorldComposite(String id,final IWorldEditor worldEditor,IXViewerFactory xViewerFactory,Composite parent,int style){
  super(parent,style);
  this.id=id;
  this.iWorldEditor=worldEditor;
  setLayout(new GridLayout(1,true));
  setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite mainComp=new Composite(this,SWT.NONE);
  mainComp.setLayout(ALayout.getZeroMarginLayout());
  mainComp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  if (!DbConnectionExceptionComposite.dbConnectionIsOk(this)) {
    worldXViewer=null;
    return;
  }
  worldXViewer=new WorldXViewer(mainComp,SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION,xViewerFactory != null ? xViewerFactory : new WorldXViewerFactory(),null);
  worldXViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  worldXViewer.setContentProvider(new WorldContentProvider(worldXViewer));
  worldXViewer.setLabelProvider(new WorldLabelProvider(worldXViewer));
  setContent(mainComp);
  setExpandHorizontal(true);
  setExpandVertical(true);
  layout();
  WorldXViewerEventManager.add(this);
}
Program: 97347
Project: 97347
Buggy source:
public void resetListValue() throws OseeCoreException {
  startParagraph();
  addWordMl(LISTNUM_FIELD);
  endParagraph();
}

Fixed version (ground truth):
public void resetListValue() throws OseeCoreException {
  startParagraph();
  append("String_Node_Str");
  append("String_Node_Str");
  addWordMl(LISTNUM_FIELD);
  endParagraph();
}
Program: 97348
Project: 97348
Buggy source:
@Override public boolean isDirty(){
  return areAttributesDirty() || hasDirtyRelations() || hasDirtyArtifactType()|| isReplaceWithVersion();
}

Fixed version (ground truth):
@Override public boolean isDirty(){
  return areAttributesDirty() || hasDirtyArtifactType() || isReplaceWithVersion();
}
Program: 97349
Project: 97349
Buggy source:
@Override public int getTransaction(){
  return getOrcsData().getVersion().getTransactionId();
}

Fixed version (ground truth):
@Override public int getTransaction(){
  int maxTransactionId=getOrcsData().getVersion().getTransactionId();
  for (  Attribute<?> attribute : getAllAttributes()) {
    maxTransactionId=Math.max(maxTransactionId,attribute.getOrcsData().getVersion().getTransactionId());
  }
  return maxTransactionId;
}
Program: 97350
Project: 97350
Buggy source:
@Test public void testDeleteArtifact() throws OseeCoreException {
  OrcsTransaction transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,"String_Node_Str");
  ArtifactWriteable artifact=transaction.createArtifact(CoreArtifactTypes.AccessControlModel,"String_Node_Str");
  transaction.commit();
  transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,"String_Node_Str");
  ArtifactReadable toDelete=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andGuidsOrHrids(artifact.getGuid()).getResults().getExactlyOne();
  ArtifactWriteable writeable=transaction.asWriteable(toDelete);
  writeable.delete();
  transaction.commit();
  toDelete=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andGuidsOrHrids(writeable.getGuid()).includeDeleted().getResults().getOneOrNull();
  Assert.assertNotNull(toDelete);
  Assert.assertTrue(toDelete.isDeleted());
}

Fixed version (ground truth):
@Test public void testDeleteArtifact() throws OseeCoreException {
  OrcsTransaction transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,testName.getMethodName());
  ArtifactWriteable artifact=transaction.createArtifact(CoreArtifactTypes.AccessControlModel,"String_Node_Str");
  transaction.commit();
  transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,testName.getMethodName());
  ArtifactReadable toDelete=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andGuidsOrHrids(artifact.getGuid()).getResults().getExactlyOne();
  ArtifactWriteable writeable=transaction.asWriteable(toDelete);
  writeable.delete();
  transaction.commit();
  toDelete=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andGuidsOrHrids(writeable.getGuid()).includeDeleted().getResults().getOneOrNull();
  Assert.assertNotNull(toDelete);
  Assert.assertTrue(toDelete.isDeleted());
}
Program: 97351
Project: 97351
Buggy source:
@Test public void testAsWritableException() throws OseeCoreException {
  ArtifactReadable guestUser=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andIds(SystemUser.Guest).getResults().getExactlyOne();
  OrcsTransaction transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,"String_Node_Str");
  ArtifactWriteable writeable=transaction.asWriteable(guestUser);
  writeable.setName("String_Node_Str");
  transaction.commit();
  thrown.expect(OseeAccessDeniedException.class);
  writeable.setName("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testAsWritableException() throws OseeCoreException {
  ArtifactReadable guestUser=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andIds(SystemUser.Guest).getResults().getExactlyOne();
  OrcsTransaction transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,testName.getMethodName());
  ArtifactWriteable writeable=transaction.asWriteable(guestUser);
  writeable.setName("String_Node_Str");
  transaction.commit();
  thrown.expect(OseeAccessDeniedException.class);
  writeable.setName("String_Node_Str");
}
Program: 97352
Project: 97352
Buggy source:
@Test public void testAsWritable() throws OseeCoreException {
  ArtifactReadable guestUser=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andIds(SystemUser.Guest).getResults().getExactlyOne();
  OrcsTransaction transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,"String_Node_Str");
  ArtifactWriteable writeable=transaction.asWriteable(guestUser);
  writeable.setName("String_Node_Str");
  Assert.assertEquals("String_Node_Str",guestUser.getName());
  transaction.commit();
  Assert.assertEquals("String_Node_Str",guestUser.getName());
  guestUser=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andIds(SystemUser.Guest).getResults().getExactlyOne();
  Assert.assertEquals("String_Node_Str",guestUser.getName());
}

Fixed version (ground truth):
@Test public void testAsWritable() throws OseeCoreException {
  ArtifactReadable guestUser=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andIds(SystemUser.Guest).getResults().getExactlyOne();
  OrcsTransaction transaction=txFactory.createTransaction(CoreBranches.COMMON,userArtifact,testName.getMethodName());
  ArtifactWriteable writeable=transaction.asWriteable(guestUser);
  writeable.setName("String_Node_Str");
  Assert.assertEquals("String_Node_Str",guestUser.getName());
  transaction.commit();
  Assert.assertEquals("String_Node_Str",guestUser.getName());
  guestUser=orcsApi.getQueryFactory(context).fromBranch(CoreBranches.COMMON).andIds(SystemUser.Guest).getResults().getExactlyOne();
  Assert.assertEquals("String_Node_Str",guestUser.getName());
}
Program: 97353
Project: 97353
Buggy source:
@Test public void testPublishWithDiffMerge() throws OseeCoreException {
  modifyOption("String_Node_Str",true);
  modifyOption("String_Node_Str",rootBranch);
  modifyOption("String_Node_Str",LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER);
  List<Artifact> artifacts=new ArrayList<Artifact>();
  Artifact updateDoc=ArtifactQuery.getArtifactFromId(docFolder.getArtId(),updateBranch);
  artifacts.add(updateDoc);
  renderer.publish(singleTemplate,null,artifacts,options);
  String resultPath=renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
  Assert.assertNotEquals(String.format("String_Node_Str",method.getQualifiedTestName()),resultPath,null);
  String contents;
  try {
    contents=getFileAsString(resultPath);
    Assert.assertTrue("String_Node_Str",contents.contains("String_Node_Str"));
    Assert.assertTrue("String_Node_Str",contents.contains("String_Node_Str"));
    basicDocumentCheck(contents,"String_Node_Str",true);
  }
 catch (  IOException ex) {
  }
}

Fixed version (ground truth):
@Test public void testPublishWithDiffMerge() throws OseeCoreException {
  modifyOption("String_Node_Str",true);
  modifyOption("String_Node_Str",rootBranch);
  modifyOption("String_Node_Str",LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER);
  List<Artifact> artifacts=new ArrayList<Artifact>();
  Artifact updateDoc=ArtifactQuery.getArtifactFromId(docFolder.getArtId(),updateBranch);
  artifacts.add(updateDoc);
  renderer.publish(singleTemplate,null,artifacts,options);
  String resultPath=renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
  Assert.assertNotEquals(String.format("String_Node_Str",method.getQualifiedTestName()),resultPath,null);
  String contents;
  try {
    contents=getFileAsString(resultPath);
    String mergeContent1="String_Node_Str";
    String mergeContent2="String_Node_Str";
    Assert.assertTrue("String_Node_Str",contents.contains(mergeContent1) || contents.contains(mergeContent2));
    Assert.assertTrue("String_Node_Str",contents.contains("String_Node_Str"));
    basicDocumentCheck(contents,"String_Node_Str",true);
  }
 catch (  IOException ex) {
  }
}
Program: 97355
Project: 97355
Buggy source:
@Override public void runOperation(VariableMap variableMap,IProgressMonitor monitor) throws Exception {
  List<Artifact> artifacts=variableMap.getArtifacts("String_Node_Str");
  if (artifacts.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  IOseeBranch branch=artifacts.get(0).getBranch();
  init();
  String scriptDir=variableMap.getString(SCRIPT_ROOT_DIR);
  Boolean checked=variableMap.getBoolean(USE_TRACE_IN_OSEE);
  Collection<String> traceHandlerIds=new LinkedList<String>();
  for (  String handler : availableTraceHandlers) {
    if (variableMap.getBoolean(handler)) {
      traceHandlerIds.add(handler);
    }
  }
  if (!checked) {
    File dir=new File(scriptDir);
    if (dir.exists()) {
      ScriptTraceabilityOperation traceOperation=new ScriptTraceabilityOperation(dir.getParentFile(),branch,false,traceHandlerIds);
      Operations.executeWorkAndCheckStatus(traceOperation,monitor);
      requirementsToCodeUnits=traceOperation.getRequirementToCodeUnitsMap();
    }
  }
  writeMainSheet(prepareSubsystemRequirements(artifacts));
  writer.endWorkbook();
  IFile iFile=OseeData.getIFile("String_Node_Str" + Lib.getDateTimeString() + "String_Node_Str");
  AIFile.writeToFile(iFile,charBak);
  Program.launch(iFile.getLocation().toOSString());
}

Fixed version (ground truth):
@Override public void runOperation(VariableMap variableMap,IProgressMonitor monitor) throws Exception {
  List<Artifact> artifacts=variableMap.getArtifacts("String_Node_Str");
  if (artifacts.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  IOseeBranch branch=artifacts.get(0).getBranch();
  init();
  String scriptDir=variableMap.getString(SCRIPT_ROOT_DIR);
  Boolean checked=variableMap.getBoolean(USE_TRACE_IN_OSEE);
  Collection<TraceHandler> traceHandlers=new LinkedList<TraceHandler>();
  for (  String handler : availableTraceHandlers) {
    if (variableMap.getBoolean(handler)) {
      TraceHandler traceHandler=TraceUnitExtensionManager.getInstance().getTraceHandlerByName(handler);
      traceHandlers.add(traceHandler);
    }
  }
  if (!checked) {
    File dir=new File(scriptDir);
    if (dir.exists()) {
      ScriptTraceabilityOperation traceOperation=new ScriptTraceabilityOperation(dir.getParentFile(),branch,false,traceHandlers);
      Operations.executeWorkAndCheckStatus(traceOperation,monitor);
      requirementsToCodeUnits=traceOperation.getRequirementToCodeUnitsMap();
    }
  }
  writeMainSheet(prepareSubsystemRequirements(artifacts));
  writer.endWorkbook();
  IFile iFile=OseeData.getIFile("String_Node_Str" + Lib.getDateTimeString() + "String_Node_Str");
  AIFile.writeToFile(iFile,charBak);
  Program.launch(iFile.getLocation().toOSString());
}
Program: 97356
Project: 97356
Buggy source:
@Override public String getXWidgetsXml() throws OseeCoreException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + USE_TRACE_IN_OSEE + "String_Node_Str");
  sb.append("String_Node_Str" + SCRIPT_ROOT_DIR + "String_Node_Str");
  availableTraceHandlers=new LinkedList<String>();
  sb.append("String_Node_Str");
  Collection<String> traceHandlers=TraceUnitExtensionManager.getInstance().getAllTraceHandlerNames();
  for (  String handler : traceHandlers) {
    sb.append(String.format(TRACE_HANDLER_CHECKBOX,handler));
    availableTraceHandlers.add(handler);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String getXWidgetsXml() throws OseeCoreException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + USE_TRACE_IN_OSEE + "String_Node_Str");
  sb.append("String_Node_Str" + SCRIPT_ROOT_DIR + "String_Node_Str");
  availableTraceHandlers=new LinkedList<String>();
  sb.append("String_Node_Str");
  Collection<String> traceHandlerNames=TraceUnitExtensionManager.getInstance().getAllTraceHandlerNames();
  for (  String handler : traceHandlerNames) {
    sb.append(String.format(TRACE_HANDLER_CHECKBOX,handler));
    availableTraceHandlers.add(handler);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 97357
Project: 97357
Buggy source:
@Override public boolean performFinish(){
  try {
    IOseeBranch branch=mainPage.getSelectedBranch();
    File file=mainPage.getImportFile();
    String[] handerIds=mainPage.getTraceUnitHandlerIds();
    Operations.executeWorkAndCheckStatus(new ScriptTraceabilityOperation(file,branch,true,Arrays.asList(handerIds)));
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,"String_Node_Str",ex);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  try {
    IOseeBranch branch=mainPage.getSelectedBranch();
    File file=mainPage.getImportFile();
    Collection<TraceHandler> handlers=new LinkedList<TraceHandler>();
    for (    String handlerId : mainPage.getTraceUnitHandlerIds()) {
      handlers.add(TraceUnitExtensionManager.getInstance().getTraceUnitHandlerById(handlerId));
    }
    Operations.executeWorkAndCheckStatus(new ScriptTraceabilityOperation(file,branch,true,handlers));
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,"String_Node_Str",ex);
  }
  return true;
}
Program: 97358
Project: 97358
Buggy source:
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  Collection<TraceHandler> traceHandlers=getTraceHandlers();
  monitor.worked(1);
  requirementData.initialize(monitor);
  if (writeOutResults) {
    excelWriter.startSheet("String_Node_Str",6);
    excelWriter.writeRow("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
  if (file.isFile()) {
    for (    String path : Lib.readListFromFile(file,true)) {
      monitor.subTask(path);
      handleDirectory(new File(path),traceHandlers);
      checkForCancelledStatus(monitor);
    }
  }
 else   if (file.isDirectory()) {
    handleDirectory(file,traceHandlers);
  }
 else {
    throw new OseeStateException("String_Node_Str",file.getCanonicalPath());
  }
  checkForCancelledStatus(monitor);
  if (writeOutResults) {
    excelWriter.endSheet();
    writeNoTraceFilesSheet();
    writeTraceCountsSheet();
    excelWriter.endWorkbook();
    IFile iFile=OseeData.getIFile("String_Node_Str");
    AIFile.writeToFile(iFile,charBak);
    Program.launch(iFile.getLocation().toOSString());
  }
}

Fixed version (ground truth):
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  monitor.worked(1);
  requirementData.initialize(monitor);
  if (writeOutResults) {
    excelWriter.startSheet("String_Node_Str",6);
    excelWriter.writeRow("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
  if (file.isFile()) {
    for (    String path : Lib.readListFromFile(file,true)) {
      monitor.subTask(path);
      handleDirectory(new File(path),traceHandlers);
      checkForCancelledStatus(monitor);
    }
  }
 else   if (file.isDirectory()) {
    handleDirectory(file,traceHandlers);
  }
 else {
    throw new OseeStateException("String_Node_Str",file.getCanonicalPath());
  }
  checkForCancelledStatus(monitor);
  if (writeOutResults) {
    excelWriter.endSheet();
    writeNoTraceFilesSheet();
    writeTraceCountsSheet();
    excelWriter.endWorkbook();
    IFile iFile=OseeData.getIFile("String_Node_Str");
    AIFile.writeToFile(iFile,charBak);
    Program.launch(iFile.getLocation().toOSString());
  }
}
Program: 97359
Project: 97359
Buggy source:
public ScriptTraceabilityOperation(File file,IOseeBranch branch,boolean writeOutResults,Collection<? extends IArtifactType> types,boolean withInheritance,Collection<String> traceHandlerIds) throws IOException {
  this(new RequirementData(branch,types,withInheritance),file,writeOutResults,traceHandlerIds);
}

Fixed version (ground truth):
public ScriptTraceabilityOperation(File file,IOseeBranch branch,boolean writeOutResults,Collection<? extends IArtifactType> types,boolean withInheritance,Collection<TraceHandler> traceHandlers) throws IOException {
  this(new RequirementData(branch,types,withInheritance),file,writeOutResults,traceHandlers);
}
Program: 97361
Project: 97361
Buggy source:
public void setCreatedBy(IAtsUser user,boolean logChange,Date date) throws OseeCoreException {
  if (logChange) {
    if (getSoleAttributeValue(AtsAttributeTypes.CreatedBy,null) == null) {
      atsLog.addLog(LogType.Originated,"String_Node_Str","String_Node_Str",date,user);
    }
 else {
      atsLog.addLog(LogType.Originated,"String_Node_Str","String_Node_Str" + AtsClientService.get().getUserAdmin().getCurrentUser().getName(),date,user);
      atsLog.internalResetOriginator(user);
    }
  }
  if (isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
    setSoleAttributeValue(AtsAttributeTypes.CreatedBy,user.getUserId());
  }
  if (isAttributeTypeValid(AtsAttributeTypes.CreatedDate)) {
    setSoleAttributeValue(AtsAttributeTypes.CreatedDate,date);
  }
  AtsNotificationManager.notify(this,AtsNotifyType.Originator);
}

Fixed version (ground truth):
public void setCreatedBy(IAtsUser user,boolean logChange) throws OseeCoreException {
  Date date=new Date();
  if (logChange) {
    logCreatedByChange(user,date);
  }
  if (isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
    setSoleAttributeValue(AtsAttributeTypes.CreatedBy,user.getUserId());
  }
  AtsNotificationManager.notify(this,AtsNotifyType.Originator);
}
Program: 97362
Project: 97362
Buggy source:
public static boolean promptChangeOriginator(final Collection<? extends AbstractWorkflowArtifact> awas,boolean persist) throws OseeCoreException {
  UserListDialog ld=new UserListDialog(Displays.getActiveShell(),"String_Node_Str",Active.Active);
  int result=ld.open();
  if (result == 0) {
    IAtsUser selectedUser=AtsClientService.get().getUserAdmin().getUserFromOseeUser(ld.getSelection());
    Date createdDate=new Date();
    for (    AbstractWorkflowArtifact awa : awas) {
      awa.setCreatedBy(selectedUser,true,createdDate);
    }
    if (persist) {
      Artifacts.persistInTransaction("String_Node_Str",awas);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean promptChangeOriginator(final Collection<? extends AbstractWorkflowArtifact> awas,boolean persist) throws OseeCoreException {
  UserListDialog ld=new UserListDialog(Displays.getActiveShell(),"String_Node_Str",Active.Active);
  int result=ld.open();
  if (result == 0) {
    IAtsUser selectedUser=AtsClientService.get().getUserAdmin().getUserFromOseeUser(ld.getSelection());
    for (    AbstractWorkflowArtifact awa : awas) {
      awa.setCreatedBy(selectedUser,true);
    }
    if (persist) {
      Artifacts.persistInTransaction("String_Node_Str",awas);
    }
    return true;
  }
  return false;
}
Program: 97363
Project: 97363
Buggy source:
@Override public void saveState(IMemento memento){
  super.saveState(memento);
  memento=memento.createChild(INPUT);
  if (sourceBranch != null) {
    memento.putInteger(SOURCE_BRANCH_ID,sourceBranch.getId());
    memento.putInteger(DEST_BRANCH_ID,destBranch.getId());
    memento.putInteger(TRANSACTION_NUMBER,transactionId.getId());
  }
 else   if (commitTrans != null) {
    memento.putInteger(COMMIT_NUMBER,commitTrans.getId());
  }
  if (sourceBranch != null || commitTrans != null) {
    SkynetViews.addDatabaseSourceId(memento);
  }
}

Fixed version (ground truth):
@Override public void saveState(IMemento memento){
  super.saveState(memento);
  if (commitTrans != null || sourceBranch != null || destBranch != null || transactionId != null) {
    try {
      IMemento childMemento=memento.createChild(INPUT);
      if (commitTrans != null) {
        childMemento.putInteger(COMMIT_NUMBER,commitTrans.getId());
      }
      if (sourceBranch != null) {
        childMemento.putInteger(SOURCE_BRANCH_ID,sourceBranch.getId());
      }
      if (destBranch != null) {
        childMemento.putInteger(DEST_BRANCH_ID,destBranch.getId());
      }
      if (transactionId != null) {
        childMemento.putInteger(TRANSACTION_NUMBER,transactionId.getId());
      }
      SkynetViews.addDatabaseSourceId(childMemento);
    }
 catch (    Exception ex) {
      OseeLog.log(Activator.class,Level.WARNING,"String_Node_Str",ex);
    }
  }
}
Program: 97364
Project: 97364
Buggy source:
@Override public String toString(){
  try {
    return String.format("String_Node_Str",getWorkPackageId(),getName());
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(org.eclipse.osee.ats.core.client.internal.Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
  return String.format("String_Node_Str",getName());
}

Fixed version (ground truth):
@Override public String toString(){
  try {
    StringBuilder builder=new StringBuilder(getActivityId());
    addWithHypen(builder,getActivityName());
    addWithHypen(builder,getWorkPackageId());
    addWithHypen(builder,getName());
    return builder.toString();
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(org.eclipse.osee.ats.core.client.internal.Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
  return String.format("String_Node_Str",getName());
}
Program: 97366
Project: 97366
Buggy source:
public static void kickLocalArtifactReloadEvent(Object source,Collection<? extends Artifact> artifacts) throws OseeCoreException {
  if (isDisableEvents()) {
    return;
  }
  ArtifactEvent artifactEvent=new ArtifactEvent(artifacts.iterator().next().getBranch(),ArtifactEventType.RELOAD_ARTIFACTS);
  artifactEvent.getArtifacts().addAll(EventBasicGuidArtifact.get(EventModType.Reloaded,artifacts));
  getEventService().send(source,artifactEvent);
}

Fixed version (ground truth):
public static void kickLocalArtifactReloadEvent(Object source,Collection<? extends Artifact> artifacts) throws OseeCoreException {
  if (isDisableEvents()) {
    return;
  }
  ArtifactEvent artifactEvent=new ArtifactEvent(artifacts.iterator().next().getBranch().getGuid(),ArtifactEventType.RELOAD_ARTIFACTS);
  artifactEvent.getArtifacts().addAll(EventBasicGuidArtifact.get(EventModType.Reloaded,artifacts));
  getEventService().send(source,artifactEvent);
}
Program: 97367
Project: 97367
Buggy source:
public ArtifactEvent(IOseeBranch branch,ArtifactEventType reloadEvent){
  this.reloadEvent=reloadEvent;
  branchGuid=branch.getGuid();
}

Fixed version (ground truth):
public ArtifactEvent(String branchGuid,ArtifactEventType reloadEvent){
  this.reloadEvent=reloadEvent;
  this.branchGuid=branchGuid;
}
Program: 97368
Project: 97368
Buggy source:
public boolean abort(Throwable th,boolean wait){
  if (abort) {
    return true;
  }
  abort=true;
  this.test.setAborted(true);
  addAbortResult(th);
  if (Thread.currentThread() == this.getThread()) {
    throw new TestException("String_Node_Str",Level.SEVERE);
  }
  if (lock.isLocked()) {
    this.interrupt();
  }
  return true;
}

Fixed version (ground truth):
public boolean abort(Throwable th,boolean wait){
  if (abort) {
    return true;
  }
  abort=true;
  this.test.setAborted(true);
  addAbortResult(th);
  if (Thread.currentThread() == this.getThread()) {
    throw new TestException("String_Node_Str",Level.SEVERE);
  }
  this.interrupt();
  return true;
}
Program: 97370
Project: 97370
Buggy source:
public void removeWidgetForAttributeType(Collection<? extends IAttributeType> attributeTypes){
  for (  IAttributeType attributeType : attributeTypes) {
    xWidgetsMap.remove(attributeType).dispose();
  }
  if (attributeTypes.size() > 0) {
    markDirty();
  }
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true);
}

Fixed version (ground truth):
public void removeWidgetForAttributeType(Collection<? extends IAttributeType> attributeTypes){
  for (  IAttributeType attributeType : attributeTypes) {
    xWidgetsMap.remove(attributeType).dispose();
  }
  if (attributeTypes.size() > 0) {
    markDirty();
  }
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true,true);
}
Program: 97371
Project: 97371
Buggy source:
public void addWidgetForAttributeType(Collection<IAttributeType> attributeTypes) throws OseeCoreException {
  Artifact artifact=editor.getEditorInput().getArtifact();
  boolean isEditable=!artifact.isReadOnly();
  for (  IAttributeType attributeType : attributeTypes) {
    Composite internalComposite;
    if (DefaultAttributeXWidgetProvider.useMultiLineWidget(attributeType) || DslGrammarManager.isDslAttributeType(attributeType)) {
      internalComposite=createAttributeTypeControlsInSection(composite,attributeType,isEditable,15);
    }
 else {
      internalComposite=createAttributeTypeControls(composite,artifact,attributeType,isEditable,false,20);
    }
    setLabelFonts(internalComposite,FontManager.getDefaultLabelFont());
    HelpUtil.setHelp(internalComposite,OseeHelpContext.ARTIFACT_EDITOR__ATTRIBUTES);
    xWidgetsMap.put(attributeType,internalComposite);
  }
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true);
}

Fixed version (ground truth):
public void addWidgetForAttributeType(Collection<IAttributeType> attributeTypes) throws OseeCoreException {
  Artifact artifact=editor.getEditorInput().getArtifact();
  boolean isEditable=!artifact.isReadOnly();
  for (  IAttributeType attributeType : attributeTypes) {
    Composite internalComposite;
    if (DefaultAttributeXWidgetProvider.useMultiLineWidget(attributeType) || DslGrammarManager.isDslAttributeType(attributeType)) {
      internalComposite=createAttributeTypeControlsInSection(composite,attributeType,isEditable,15);
    }
 else {
      internalComposite=createAttributeTypeControls(composite,artifact,attributeType,isEditable,false,20);
    }
    setLabelFonts(internalComposite,FontManager.getDefaultLabelFont());
    HelpUtil.setHelp(internalComposite,OseeHelpContext.ARTIFACT_EDITOR__ATTRIBUTES);
    xWidgetsMap.put(attributeType,internalComposite);
  }
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true,true);
}
Program: 97372
Project: 97372
Buggy source:
public static void checkNotNullOrEmpty(String object,String objectName,String details,Object... data) throws OseeCoreException {
  checkNotNull(object,objectName);
  if (object.length() == 0) {
    String message=String.format(details,data);
    throw new OseeArgumentException("String_Node_Str",objectName,message);
  }
}

Fixed version (ground truth):
public static void checkNotNullOrEmpty(String object,String objectName,String details,Object... data) throws OseeCoreException {
  checkNotNull(object,objectName,details,data);
  if (object.length() == 0) {
    String message=String.format(details,data);
    throw new OseeArgumentException("String_Node_Str",objectName,message);
  }
}
Program: 97373
Project: 97373
Buggy source:
public static void openPerspective(String perspId){
  IAdaptable input=ResourcesPlugin.getWorkspace();
  @SuppressWarnings("String_Node_Str") AbstractUIPlugin plugin=(AbstractUIPlugin)Platform.getPlugin(PlatformUI.PLUGIN_ID);
  IPreferenceStore store=plugin.getPreferenceStore();
  String pref=store.getString(IWorkbenchPreferenceConstants.OPEN_NEW_PERSPECTIVE);
  try {
    if (pref.equals(IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_WINDOW)) {
      PlatformUI.getWorkbench().openWorkbenchWindow(perspId,input);
    }
 else     if (pref.equals(IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE)) {
      IPerspectiveRegistry reg=PlatformUI.getWorkbench().getPerspectiveRegistry();
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(reg.findPerspectiveWithId(perspId));
    }
  }
 catch (  WorkbenchException ex) {
    OseeLog.log(OseeUiActivator.class,OseeLevel.SEVERE_POPUP,ex);
  }
}

Fixed version (ground truth):
public static void openPerspective(final String perspId){
  final IWorkbenchWindow workbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  IPerspectiveDescriptor activePerspective=workbenchWindow.getActivePage().getPerspective();
  if (activePerspective == null || !activePerspective.getId().equals(perspId)) {
    Display.getCurrent().asyncExec(new Runnable(){
      @Override public void run(){
        try {
          workbenchWindow.getWorkbench().showPerspective(perspId,workbenchWindow);
        }
 catch (        WorkbenchException ex) {
          OseeLog.log(OseeUiActivator.class,OseeLevel.SEVERE_POPUP,ex);
        }
      }
    }
);
  }
}
Program: 97374
Project: 97374
Buggy source:
private void populateBaseTransaction(double workAmount,OseeConnection connection,Branch branch,int mergeAddressingQueryId) throws OseeCoreException {
  if (branch.getBranchType() != BranchType.SYSTEM_ROOT) {
    List<Object[]> data=new ArrayList<Object[]>();
    HashSet<Integer> gammas=new HashSet<Integer>(100000);
    int parentBranchId=-1;
    if (branch.hasParentBranch()) {
      parentBranchId=branch.getParentBranch().getId();
    }
    int baseTxId=branch.getBaseTransaction().getId();
    if (branch.getBranchType().isMergeBranch()) {
      populateAddressingToCopy(connection,data,baseTxId,gammas,SELECT_ATTRIBUTE_ADDRESSING_FROM_JOIN,parentBranchId,TxChange.NOT_CURRENT.getValue(),mergeAddressingQueryId);
      populateAddressingToCopy(connection,data,baseTxId,gammas,SELECT_ARTIFACT_ADDRESSING_FROM_JOIN,parentBranchId,TxChange.NOT_CURRENT.getValue(),mergeAddressingQueryId);
    }
 else {
      populateAddressingToCopy(connection,data,baseTxId,gammas,SELECT_ADDRESSING,TxChange.NOT_CURRENT.getValue(),parentBranchId,branch.getSourceTransaction().getId());
    }
    if (!data.isEmpty()) {
      getDatabaseService().runBatchUpdate(connection,INSERT_ADDRESSING,data);
    }
  }
  checkForCancelled();
}

Fixed version (ground truth):
private void populateBaseTransaction(double workAmount,OseeConnection connection,Branch branch,int mergeAddressingQueryId) throws OseeCoreException {
  if (branch.getBranchType() != BranchType.SYSTEM_ROOT) {
    List<Object[]> data=new ArrayList<Object[]>();
    HashSet<Integer> gammas=new HashSet<Integer>(100000);
    int parentBranchId=-1;
    if (branch.hasParentBranch()) {
      parentBranchId=branch.getParentBranch().getId();
    }
    int baseTxId=branch.getBaseTransaction().getId();
    if (branch.getBranchType().isMergeBranch()) {
      populateAddressingToCopy(connection,data,baseTxId,gammas,SELECT_ATTRIBUTE_ADDRESSING_FROM_JOIN,parentBranchId,TxChange.NOT_CURRENT.getValue(),mergeAddressingQueryId);
      populateAddressingToCopy(connection,data,baseTxId,gammas,SELECT_ARTIFACT_ADDRESSING_FROM_JOIN,parentBranchId,TxChange.NOT_CURRENT.getValue(),mergeAddressingQueryId);
    }
 else {
      populateAddressingToCopy(connection,data,baseTxId,gammas,SELECT_ADDRESSING,parentBranchId,branch.getSourceTransaction().getId());
    }
    if (!data.isEmpty()) {
      getDatabaseService().runBatchUpdate(connection,INSERT_ADDRESSING,data);
    }
  }
  checkForCancelled();
}
Program: 97377
Project: 97377
Buggy source:
public void setInput(Object input){
  if (input instanceof ArtifactEditor) {
    this.editor=(ArtifactEditor)input;
    if (getTreeViewer() != null) {
      getTreeViewer().setInput(editor != null ? editor : "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void setInput(Object input){
  if (input instanceof ArtifactEditor) {
    this.editor=(ArtifactEditor)input;
    if (getTreeViewer() != null && Widgets.isAccessible(getTreeViewer().getTree())) {
      getTreeViewer().setInput(editor != null ? editor : "String_Node_Str");
    }
  }
}
Program: 97378
Project: 97378
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(),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());
}

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(),null,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(),null,readOnlyTestUnitNames).delete(transaction,coverageEvent,false);
  transaction.execute();
  artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),null,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: 97379
Project: 97379
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(),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);
}

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(),null,readOnlyTestUnitNames).getArtifact(false);
  Assert.assertNull("String_Node_Str",artifact);
  artifact=new OseeCoverageUnitStore(parentCu,CoverageTestUtil.getTestBranch(),null,readOnlyTestUnitNames).getArtifact(true);
  CoverageTestUtil.registerAsTestArtifact(artifact);
  artifact.persist(getClass().getSimpleName());
  Assert.assertNotNull("String_Node_Str",artifact);
}
Program: 97380
Project: 97380
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(),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());
}

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(),null,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(),null,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: 97381
Project: 97381
Buggy source:
@Override public void saveTestUnitNames(SkynetTransaction transaction){
}

Fixed version (ground truth):
@Override public void saveTestUnitNames(SkynetTransaction transaction) throws OseeCoreException {
  for (  CoverageUnit coverageUnit : coveragePackage.getCoverageUnits()) {
    OseeCoverageUnitStore store=new OseeCoverageUnitStore(coverageUnit,artifact.getBranch(),artifact,null);
    store.saveTestUnitNames(transaction);
    Artifact childArt=store.getArtifact(false);
    if (childArt.getParent() == null && !artifact.getChildren().contains(childArt)) {
      artifact.addChild(store.getArtifact(false));
    }
  }
}
Program: 97382
Project: 97382
Buggy source:
private ITestUnitProvider getTestUnitProvider(){
  ITestUnitProvider testUnitProvider=testUnitProviderMap.get(branch);
  if (testUnitProvider == null) {
    ArtifactTestUnitStore store=new ArtifactTestUnitStore(coveragePackage,readOnlyTestUnitNames);
    testUnitProvider=new TestUnitCache(store);
    testUnitProviderMap.put(branch,testUnitProvider);
  }
  return testUnitProvider;
}

Fixed version (ground truth):
private ITestUnitProvider getTestUnitProvider(){
  ITestUnitProvider testUnitProvider=testUnitProviderMap.get(coveragePackage);
  if (testUnitProvider == null) {
    ArtifactTestUnitStore store=new ArtifactTestUnitStore(coveragePackage,readOnlyTestUnitNames);
    testUnitProvider=new TestUnitCache(store);
    testUnitProviderMap.put(coveragePackage,testUnitProvider);
  }
  return testUnitProvider;
}
Program: 97383
Project: 97383
Buggy source:
public OseeCoverageUnitStore(CoverageUnit coverageUnit,IOseeBranch branch,Artifact testUnitNames){
  super(coverageUnit,coverageUnit.isFolder() ? CoverageArtifactTypes.CoverageFolder : CoverageArtifactTypes.CoverageUnit,branch);
  this.coverageUnit=coverageUnit;
  this.coveragePackage=null;
  this.readOnlyTestUnitNames=testUnitNames;
}

Fixed version (ground truth):
public OseeCoverageUnitStore(CoverageUnit coverageUnit,IOseeBranch branch,Artifact coveragePackage,Artifact testUnitNames){
  super(coverageUnit,coverageUnit.isFolder() ? CoverageArtifactTypes.CoverageFolder : CoverageArtifactTypes.CoverageUnit,branch);
  this.coverageUnit=coverageUnit;
  this.coveragePackage=coveragePackage;
  this.readOnlyTestUnitNames=testUnitNames;
}