nus-yam/ex-repair huggingface dataset:
Program: 97522
Project: 97522
Buggy source:
private Set<String> determineManagedViews(){
  Set<String> managedViewIds=new HashSet<String>();
  IExtensionRegistry extensionRegistry=Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint=extensionRegistry.getExtensionPoint("String_Node_Str");
  IExtension[] extensions=extensionPoint.getExtensions();
  for (  IExtension ex : extensions) {
    String name=ex.getContributor().getName();
    if (managedArea.getByBundleName(name) != null) {
      IConfigurationElement[] elements=ex.getConfigurationElements();
      for (      IConfigurationElement el : elements) {
        if (el.getName().equals(TAG_VIEW)) {
          String id=el.getAttribute("String_Node_Str");
          if (id != null) {
            managedViewIds.add(id);
          }
        }
      }
    }
  }
  return managedViewIds;
}

Fixed version (ground truth):
private Set<String> determineManagedViews(List<BundleInfoLite> uninstallList){
  Set<String> managedViewIds=new HashSet<String>();
  IExtensionRegistry extensionRegistry=Platform.getExtensionRegistry();
  IExtensionPoint extensionPoint=extensionRegistry.getExtensionPoint("String_Node_Str");
  IExtension[] extensions=extensionPoint.getExtensions();
  for (  IExtension ex : extensions) {
    String name=ex.getContributor().getName();
    if (managedArea.getByBundleName(name) != null) {
      IConfigurationElement[] elements=ex.getConfigurationElements();
      for (      IConfigurationElement el : elements) {
        if (el.getName().equals(TAG_VIEW)) {
          String id=el.getAttribute("String_Node_Str");
          if (id != null) {
            if (uninstallList != null) {
              for (              BundleInfoLite infoLite : uninstallList) {
                if (name.equals(infoLite.getSymbolicName())) {
                  managedViewIds.add(id);
                  break;
                }
              }
            }
 else {
              managedViewIds.add(id);
            }
          }
        }
      }
    }
  }
  return managedViewIds;
}
Program: 97523
Project: 97523
Buggy source:
@Override public void frameworkEvent(FrameworkEvent event){
  if (FrameworkEvent.PACKAGES_REFRESHED == event.getType()) {
    startBundles(bundles,master.newChild(80));
    waitForViewsToBeRegistered(master.newChild(15));
    PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        restoreStateFromMemento(master.newChild(5));
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void frameworkEvent(FrameworkEvent event){
  if (FrameworkEvent.PACKAGES_REFRESHED == event.getType()) {
    startBundles(bundles,master.newChild(80));
    waitForViewsToBeRegistered(master.newChild(15));
    PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        restoreStateFromMemento(master.newChild(5));
      }
    }
);
synchronized (waitForLoad) {
      waitForLoad.notifyAll();
    }
  }
}
Program: 97525
Project: 97525
Buggy source:
@Test public void testHashCode(){
  WorkDefinition obj=new WorkDefinition("String_Node_Str");
  Assert.assertEquals(99162353,obj.hashCode());
  obj=new WorkDefinition("String_Node_Str");
  obj.setName(null);
  Assert.assertEquals(31,obj.hashCode());
}

Fixed version (ground truth):
@Test public void testHashCode(){
  WorkDefinition obj=new WorkDefinition("String_Node_Str");
  Assert.assertEquals(99162353,obj.hashCode());
  obj=new WorkDefinition("String_Node_Str");
  obj.setId(null);
  Assert.assertEquals(31,obj.hashCode());
}
Program: 97526
Project: 97526
Buggy source:
@Test public void testGetIds(){
  WorkDefinition def=new WorkDefinition("String_Node_Str");
  Assert.assertEquals("String_Node_Str",def.getId());
  Assert.assertEquals("String_Node_Str",def.getId());
  def.setId("String_Node_Str");
  Assert.assertEquals("String_Node_Str",def.getId());
  def.setId("String_Node_Str");
  Assert.assertEquals("String_Node_Str",def.getId());
}

Fixed version (ground truth):
@Test public void testGetIds(){
  WorkDefinition def=new WorkDefinition("String_Node_Str");
  Assert.assertEquals("String_Node_Str",def.getId());
  def.setId("String_Node_Str");
  Assert.assertEquals("String_Node_Str",def.getId());
  def.setId("String_Node_Str");
  Assert.assertEquals("String_Node_Str",def.getId());
}
Program: 97527
Project: 97527
Buggy source:
@Test public void testEqualsObject(){
  IAtsWorkDefinition obj=new WorkDefinition("String_Node_Str");
  Assert.assertTrue(obj.equals(obj));
  IAtsWorkDefinition obj2=new WorkDefinition("String_Node_Str");
  Assert.assertTrue(obj.equals(obj2));
  Assert.assertFalse(obj.equals(null));
  Assert.assertFalse(obj.equals("String_Node_Str"));
  WorkDefinition obj3=new WorkDefinition("String_Node_Str");
  obj3.setName(null);
  Assert.assertFalse(obj.equals(obj3));
  Assert.assertFalse(obj3.equals(obj));
  WorkDefinition obj4=new WorkDefinition("String_Node_Str");
  obj4.setName(null);
  Assert.assertFalse(obj3.equals(obj4));
}

Fixed version (ground truth):
@Test public void testEqualsObject(){
  IAtsWorkDefinition obj=new WorkDefinition("String_Node_Str");
  Assert.assertTrue(obj.equals(obj));
  IAtsWorkDefinition obj2=new WorkDefinition("String_Node_Str");
  Assert.assertTrue(obj.equals(obj2));
  Assert.assertFalse(obj.equals(null));
  Assert.assertFalse(obj.equals("String_Node_Str"));
  WorkDefinition obj3=new WorkDefinition("String_Node_Str");
  obj3.setId(null);
  Assert.assertFalse(obj.equals(obj3));
  Assert.assertFalse(obj3.equals(obj));
  WorkDefinition obj4=new WorkDefinition("String_Node_Str");
  obj4.setName(null);
  Assert.assertFalse(obj3.equals(obj4));
}
Program: 97529
Project: 97529
Buggy source:
@Override public Collection<ChangeItem> createMissingChanges(List<ChangeItem> changes,TransactionRecord sourceTx,TransactionRecord destTx,String sessionId) throws OseeCoreException {
  if (changes != null && !changes.isEmpty()) {
    Set<Integer> modifiedArtIds=new HashSet<Integer>();
    Multimap<Integer,Integer> modifiedAttrIds=LinkedListMultimap.create();
    Multimap<Integer,Integer> modifiedRels=LinkedListMultimap.create();
    for (    ChangeItem change : changes) {
      if (change instanceof AttributeChangeItem) {
        modifiedAttrIds.put(change.getArtId(),change.getItemId());
      }
 else       if (change instanceof ArtifactChangeItem) {
        if (!change.isSynthetic()) {
          modifiedArtIds.add(change.getArtId());
        }
      }
 else       if (change instanceof RelationChangeItem) {
        modifiedRels.put(change.getArtId(),change.getItemId());
      }
    }
    Set<Integer> allArtIds=new HashSet<Integer>(modifiedArtIds);
    allArtIds.addAll(modifiedAttrIds.keySet());
    allArtIds.addAll(modifiedRels.keySet());
    Set<Integer> missingArtIds=determineWhichArtifactsNotOnDestination(allArtIds,destTx,sessionId);
    if (!missingArtIds.isEmpty()) {
      return createMissingChangeItems(sourceTx,destTx,sessionId,modifiedArtIds,modifiedAttrIds,modifiedRels,missingArtIds,allArtIds);
    }
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
@Override public Collection<ChangeItem> createMissingChanges(List<ChangeItem> changes,TransactionRecord sourceTx,TransactionRecord destTx,String sessionId) throws OseeCoreException {
  if (changes != null && !changes.isEmpty()) {
    Set<Integer> modifiedArtIds=new HashSet<Integer>();
    Multimap<Integer,Integer> modifiedAttrIds=LinkedListMultimap.create();
    Multimap<Integer,Integer> modifiedRels=LinkedListMultimap.create();
    for (    ChangeItem change : changes) {
      if (change instanceof AttributeChangeItem) {
        modifiedAttrIds.put(change.getArtId(),change.getItemId());
      }
 else       if (change instanceof ArtifactChangeItem) {
        if (!change.isSynthetic()) {
          modifiedArtIds.add(change.getArtId());
        }
      }
 else       if (change instanceof RelationChangeItem) {
        modifiedRels.put(change.getArtId(),change.getItemId());
        modifiedRels.put(((RelationChangeItem)change).getBArtId(),change.getItemId());
      }
    }
    Set<Integer> allArtIds=new HashSet<Integer>(modifiedArtIds);
    allArtIds.addAll(modifiedAttrIds.keySet());
    allArtIds.addAll(modifiedRels.keySet());
    Set<Integer> missingArtIds=determineWhichArtifactsNotOnDestination(allArtIds,destTx,sessionId);
    if (!missingArtIds.isEmpty()) {
      return createMissingChangeItems(sourceTx,destTx,sessionId,modifiedArtIds,modifiedAttrIds,modifiedRels,missingArtIds,allArtIds);
    }
  }
  return Collections.emptyList();
}
Program: 97530
Project: 97530
Buggy source:
private static Collection<IXWidgetProvider> getXWidgetProviders(){
  ExtensionDefinedObjects<IXWidgetProvider> contributions=new ExtensionDefinedObjects<IXWidgetProvider>(Activator.PLUGIN_ID + "String_Node_Str","String_Node_Str","String_Node_Str");
  return contributions.getObjects();
}

Fixed version (ground truth):
private static Collection<IXWidgetProvider> getXWidgetProviders(){
  ExtensionDefinedObjects<IXWidgetProvider> contributions=new ExtensionDefinedObjects<IXWidgetProvider>(Activator.PLUGIN_ID + "String_Node_Str","String_Node_Str","String_Node_Str",true);
  return contributions.getObjects();
}
Program: 97531
Project: 97531
Buggy source:
public boolean isWordAttribute(){
  return isWordAttribute;
}

Fixed version (ground truth):
public boolean isWordAttribute(){
  boolean toReturn=false;
  try {
    toReturn=getAttributeType().equals(CoreAttributeTypes.WordTemplateContent);
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(getClass(),OseeLevel.SEVERE_POPUP,ex);
  }
  return toReturn;
}
Program: 97532
Project: 97532
Buggy source:
@Override public String getMergeDisplayData() throws OseeCoreException {
  ConflictStatus status=getStatus();
  if (status.isUntouched() && !(sourceEqualsDestination() && mergeEqualsSource()) || status.isInformational()) {
    return NO_VALUE;
  }
  if (!isWordAttribute) {
    return getMergeObject() == null ? null : getMergeObject().toString();
  }
  return AttributeConflict.STREAM_DATA;
}

Fixed version (ground truth):
@Override public String getMergeDisplayData() throws OseeCoreException {
  ConflictStatus status=getStatus();
  if (status.isUntouched() && !(sourceEqualsDestination() && mergeEqualsSource()) || status.isInformational()) {
    return NO_VALUE;
  }
  if (!isWordAttribute()) {
    return getMergeObject() == null ? null : getMergeObject().toString();
  }
  return AttributeConflict.STREAM_DATA;
}
Program: 97533
Project: 97533
Buggy source:
public AttributeConflict(int sourceGamma,int destGamma,int artId,TransactionRecord commitTransaction,String sourceValue,int attrId,int attrTypeId,Branch mergeBranch,Branch destBranch) throws OseeCoreException {
  super(sourceGamma,destGamma,artId,commitTransaction,mergeBranch,destBranch);
  this.attrId=attrId;
  this.attrTypeId=attrTypeId;
  this.status=ConflictStatus.EDITED;
  this.isWordAttribute=getAttributeType().equals(CoreAttributeTypes.WordTemplateContent);
  computeEqualsValues();
}

Fixed version (ground truth):
public AttributeConflict(int sourceGamma,int destGamma,int artId,TransactionRecord commitTransaction,String sourceValue,int attrId,int attrTypeId,Branch mergeBranch,Branch destBranch) throws OseeCoreException {
  super(sourceGamma,destGamma,artId,commitTransaction,mergeBranch,destBranch);
  this.attrId=attrId;
  this.attrTypeId=attrTypeId;
  this.status=ConflictStatus.EDITED;
  computeEqualsValues();
}
Program: 97534
Project: 97534
Buggy source:
public boolean wordMarkupPresent() throws OseeCoreException {
  if (isWordAttribute && ((WordAttribute)getAttribute()).containsWordAnnotations()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean wordMarkupPresent() throws OseeCoreException {
  if (isWordAttribute() && ((WordAttribute)getAttribute()).containsWordAnnotations()) {
    return true;
  }
  return false;
}
Program: 97535
Project: 97535
Buggy source:
@Override public String getDestDisplayData() throws OseeCoreException {
  String displayValue=isWordAttribute ? STREAM_DATA : getDestObject() == null ? "String_Node_Str" : getDestObject().toString();
  try {
    getDestAttribute();
  }
 catch (  AttributeDoesNotExist ex) {
    displayValue="String_Node_Str";
  }
  return displayValue;
}

Fixed version (ground truth):
@Override public String getDestDisplayData() throws OseeCoreException {
  String displayValue=isWordAttribute() ? STREAM_DATA : getDestObject() == null ? "String_Node_Str" : getDestObject().toString();
  try {
    getDestAttribute();
  }
 catch (  AttributeDoesNotExist ex) {
    displayValue="String_Node_Str";
  }
  return displayValue;
}
Program: 97536
Project: 97536
Buggy source:
@Override public String getSourceDisplayData() throws OseeCoreException {
  String displayValue=isWordAttribute ? STREAM_DATA : getSourceObject() == null ? "String_Node_Str" : getSourceObject().toString();
  try {
    getSourceAttribute(false);
  }
 catch (  AttributeDoesNotExist ex) {
    displayValue="String_Node_Str";
  }
  return displayValue;
}

Fixed version (ground truth):
@Override public String getSourceDisplayData() throws OseeCoreException {
  String displayValue=isWordAttribute() ? STREAM_DATA : getSourceObject() == null ? "String_Node_Str" : getSourceObject().toString();
  try {
    getSourceAttribute(false);
  }
 catch (  AttributeDoesNotExist ex) {
    displayValue="String_Node_Str";
  }
  return displayValue;
}
Program: 97537
Project: 97537
Buggy source:
@Override public boolean clearValue() throws OseeCoreException {
  if (!getStatus().isOverwriteAllowed()) {
    if (DEBUG) {
      System.out.println(String.format("String_Node_Str",getAttrId()));
    }
    return false;
  }
  if (DEBUG) {
    System.out.println(String.format("String_Node_Str",getAttrId()));
  }
  setStatus(ConflictStatus.UNTOUCHED);
  if (isWordAttribute) {
    getAttribute().resetToDefaultValue();
    getArtifact().persist(getClass().getSimpleName());
  }
 else {
    getArtifact().setSoleAttributeFromString(getAttributeType(),NO_VALUE);
    getArtifact().persist(getClass().getSimpleName());
  }
  computeEqualsValues();
  return true;
}

Fixed version (ground truth):
@Override public boolean clearValue() throws OseeCoreException {
  if (!getStatus().isOverwriteAllowed()) {
    if (DEBUG) {
      System.out.println(String.format("String_Node_Str",getAttrId()));
    }
    return false;
  }
  if (DEBUG) {
    System.out.println(String.format("String_Node_Str",getAttrId()));
  }
  setStatus(ConflictStatus.UNTOUCHED);
  if (isWordAttribute()) {
    getAttribute().resetToDefaultValue();
    getArtifact().persist(getClass().getSimpleName());
  }
 else {
    getArtifact().setSoleAttributeFromString(getAttributeType(),NO_VALUE);
    getArtifact().persist(getClass().getSimpleName());
  }
  computeEqualsValues();
  return true;
}
Program: 97538
Project: 97538
Buggy source:
@Override public void setStatus(ConflictStatus status) throws OseeCoreException {
  if (status.equals(ConflictStatus.RESOLVED) && isWordAttribute && ((WordAttribute)getAttribute()).containsWordAnnotations()) {
    throw new OseeStateException(RESOLVE_MERGE_MARKUP);
  }
  super.setStatus(status);
}

Fixed version (ground truth):
@Override public void setStatus(ConflictStatus status) throws OseeCoreException {
  if (status.equals(ConflictStatus.RESOLVED) && isWordAttribute() && ((WordAttribute)getAttribute()).containsWordAnnotations()) {
    throw new OseeStateException(RESOLVE_MERGE_MARKUP);
  }
  super.setStatus(status);
}
Program: 97539
Project: 97539
Buggy source:
public AbstractSelectionEnabledHandler(MenuManager menuManager){
  menuManager.getMenu().addMenuListener(this);
}

Fixed version (ground truth):
protected AbstractSelectionEnabledHandler(){
}
Program: 97540
Project: 97540
Buggy source:
@Override public void createCommonSection(List<XNavigateItem> items,List<String> excludeSectionIds){
  Map<String,XNavigateItem> nameToParent=new HashMap<String,XNavigateItem>();
  XNavigateItem blamOperationItems=new XNavigateItem(null,"String_Node_Str",FrameworkImage.BLAM);
  for (  AbstractBlam blamOperation : BlamContributionManager.getBlamOperations()) {
    for (    String category : blamOperation.getCategories()) {
      try {
        if (AccessControlManager.isOseeAdmin() || !category.contains("String_Node_Str") || category.contains("String_Node_Str") && AccessControlManager.isOseeAdmin()) {
          createCategories(category.split("String_Node_Str"),0,blamOperationItems,nameToParent);
        }
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
      }
    }
  }
  for (  AbstractBlam blamOperation : BlamContributionManager.getBlamOperations()) {
    if (blamOperation.getCategories().isEmpty()) {
      new XNavigateItemBlam(blamOperationItems,blamOperation);
    }
    for (    String category : blamOperation.getCategories()) {
      if (nameToParent.get(category) != null) {
        new XNavigateItemBlam(nameToParent.get(category),blamOperation);
      }
    }
  }
  items.add(blamOperationItems);
}

Fixed version (ground truth):
@Override public void createCommonSection(List<XNavigateItem> items,List<String> excludeSectionIds){
  Map<String,XNavigateItem> nameToParent=new HashMap<String,XNavigateItem>();
  XNavigateItem blamOperationItems=new XNavigateItem(null,"String_Node_Str",FrameworkImage.BLAM);
  for (  AbstractBlam blamOperation : getBlamOperations()) {
    for (    String category : blamOperation.getCategories()) {
      try {
        if (AccessControlManager.isOseeAdmin() || !category.contains("String_Node_Str") || category.contains("String_Node_Str") && AccessControlManager.isOseeAdmin()) {
          createCategories(category.split("String_Node_Str"),0,blamOperationItems,nameToParent);
        }
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
      }
    }
  }
  for (  AbstractBlam blamOperation : BlamContributionManager.getBlamOperations()) {
    if (blamOperation.getCategories().isEmpty()) {
      new XNavigateItemBlam(blamOperationItems,blamOperation);
    }
    for (    String category : blamOperation.getCategories()) {
      if (nameToParent.get(category) != null) {
        new XNavigateItemBlam(nameToParent.get(category),blamOperation);
      }
    }
  }
  items.add(blamOperationItems);
}
Program: 97541
Project: 97541
Buggy source:
public static Map<String,AbstractBlam> getBlamMap(){
  if (blams == null) {
    ExtensionDefinedObjects<AbstractBlam> definedObjects=new ExtensionDefinedObjects<AbstractBlam>("String_Node_Str","String_Node_Str","String_Node_Str");
    blams=new TreeMap<String,AbstractBlam>();
    for (    AbstractBlam blam : definedObjects.getObjects()) {
      blams.put(blam.getName(),blam);
    }
  }
  return blams;
}

Fixed version (ground truth):
public synchronized static Map<String,AbstractBlam> getBlamMap(){
  if (blams == null) {
    blams=new TreeMap<String,AbstractBlam>();
    ExtensionDefinedObjects<AbstractBlam> definedObjects=new ExtensionDefinedObjects<AbstractBlam>("String_Node_Str","String_Node_Str","String_Node_Str");
    for (    AbstractBlam blam : definedObjects.getObjects()) {
      blams.put(blam.getName(),blam);
    }
  }
  return blams;
}
Program: 97542
Project: 97542
Buggy source:
/** 
 * @return true if the cycleCount == 0, otherwise false
 */
public boolean cycleOccurred(){
  if (cycleCount == -1) {
    return true;
  }
  if (cycleCount == 0) {
synchronized (objToNotify) {
      objToNotify.setTimeout(true);
      objToNotify.notifyAll();
    }
    return true;
  }
  cycleCount--;
  return false;
}

Fixed version (ground truth):
/** 
 * @return true if the countdown is complete/canceled, otherwise false
 */
public boolean cycleOccurred(){
  if (cycleCount == 0 && !completed) {
    completed=true;
synchronized (objToNotify) {
      objToNotify.setTimeout(true);
      objToNotify.notifyAll();
    }
  }
 else {
    cycleCount--;
  }
  return completed;
}
Program: 97543
Project: 97543
Buggy source:
/** 
 * @param objToNotify The Object that is in wait() on which we will call notifyAll()
 * @param cycleCount The number of cycles to countdown.
 */
public CycleCountDown(IScriptControl scriptLock,ITimeout objToNotify,int cycleCount){
  super();
  this.scriptLock=scriptLock;
  this.cycleCount=cycleCount;
  this.objToNotify=objToNotify;
  objToNotify.setTimeout(false);
}

Fixed version (ground truth):
/** 
 * @param objToNotify The Object that is in wait() on which we will call notifyAll()
 * @param cycleCount The number of cycles to countdown.
 */
public CycleCountDown(IScriptControl scriptLock,ITimeout objToNotify,int cycleCount){
  super();
  this.scriptLock=scriptLock;
  this.cycleCount=cycleCount;
  this.objToNotify=objToNotify;
  this.completed=false;
  objToNotify.setTimeout(false);
}
Program: 97544
Project: 97544
Buggy source:
@Override public void cancelTimer(){
  this.cycleCount=-1;
  if (this.scriptLock != null) {
    this.scriptLock.lock();
  }
}

Fixed version (ground truth):
@Override public void cancelTimer(){
  this.completed=true;
  if (this.scriptLock != null) {
    this.scriptLock.lock();
  }
}
Program: 97545
Project: 97545
Buggy source:
@Override public ICancelTimer setTimerFor(ITimeout objToNotify,int milliseconds){
  try {
    scriptControl.unlock();
  }
 catch (  IllegalMonitorStateException ex) {
    if (!Thread.currentThread().getName().contains("String_Node_Str") || !Thread.currentThread().getName().contains("String_Node_Str")) {
      OseeLog.log(MessageSystemTestEnvironment.class,Level.SEVERE,ex);
    }
  }
  CycleCountDown cycleCountDown=new CycleCountDown(scriptControl,objToNotify,(int)Math.rint(milliseconds / (1000.0 / EnvironmentTask.cycleResolution)) - 1);
synchronized (cycleCounters) {
    cycleCounters.add(cycleCountDown);
  }
  return cycleCountDown;
}

Fixed version (ground truth):
@Override public ICancelTimer setTimerFor(ITimeout objToNotify,int milliseconds){
  CycleCountDown cycleCountDown=new CycleCountDown(scriptControl,objToNotify,(int)Math.rint(milliseconds / (1000.0 / EnvironmentTask.cycleResolution)) - 1);
synchronized (cycleCounters) {
    cycleCounters.add(cycleCountDown);
  }
  try {
    scriptControl.unlock();
  }
 catch (  IllegalMonitorStateException ex) {
    if (!Thread.currentThread().getName().contains("String_Node_Str") || !Thread.currentThread().getName().contains("String_Node_Str")) {
      OseeLog.log(MessageSystemTestEnvironment.class,Level.SEVERE,ex);
    }
  }
  return cycleCountDown;
}
Program: 97546
Project: 97546
Buggy source:
@Before public void init() throws OseeCoreException {
  MockitoAnnotations.initMocks(this);
  artifactFactory=new ArtifactFactory(dataFactory,attributeFactory,relationFactory,artifactTypeCache,branchCache);
  guid=GUID.create();
  types=new ArrayList<IAttributeType>();
  types.add(CoreAttributeTypes.RelationOrder);
  types.add(CoreAttributeTypes.City);
  types.add(CoreAttributeTypes.Annotation);
  when(artifactData.getLocalId()).thenReturn(45);
  when(artifactData.getGuid()).thenReturn(guid);
  when(artifactData.getTypeUuid()).thenReturn(65L);
  when(artifactData.getVersion()).thenReturn(artifactVersion);
  when(artifactVersion.getBranchId()).thenReturn(23);
  when(otherArtifactData.getLocalId()).thenReturn(45);
  when(otherArtifactData.getGuid()).thenReturn(guid);
  when(otherArtifactData.getTypeUuid()).thenReturn(65L);
  when(otherArtifactData.getVersion()).thenReturn(artifactVersion);
  when(relationFactory.createRelationContainer(45)).thenReturn(relationContainer);
  when(artifactTypeCache.getByGuid(65L)).thenReturn(artifactType);
  when(branchCache.getById(23)).thenReturn(branch);
}

Fixed version (ground truth):
@Before public void init() throws OseeCoreException {
  MockitoAnnotations.initMocks(this);
  artifactFactory=new ArtifactFactory(dataFactory,attributeFactory,relationFactory,artifactTypeCache,branchCache);
  guid=GUID.create();
  types=new ArrayList<IAttributeType>();
  types.add(CoreAttributeTypes.RelationOrder);
  types.add(CoreAttributeTypes.City);
  types.add(CoreAttributeTypes.Annotation);
  when(artifactData.getLocalId()).thenReturn(45);
  when(artifactData.getGuid()).thenReturn(guid);
  when(artifactData.getTypeUuid()).thenReturn(65L);
  when(artifactData.getVersion()).thenReturn(artifactVersion);
  when(artifactVersion.getBranchId()).thenReturn(23);
  when(attributeFactory.copyAttribute(any(AttributeData.class),any(IOseeBranch.class),any(AttributeManager.class))).thenReturn(attribute);
  when(otherArtifactData.getLocalId()).thenReturn(45);
  when(otherArtifactData.getGuid()).thenReturn(guid);
  when(otherArtifactData.getTypeUuid()).thenReturn(65L);
  when(otherArtifactData.getVersion()).thenReturn(artifactVersion);
  when(relationFactory.createRelationContainer(45)).thenReturn(relationContainer);
  when(artifactTypeCache.getByGuid(65L)).thenReturn(artifactType);
  when(branchCache.getById(23)).thenReturn(branch);
}
Program: 97547
Project: 97547
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetAttributesFromStringsCreateOne() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  when(attributeType.getMaxOccurrences()).thenReturn(3);
  when(attributeFactory.createAttributeWithDefaults(eq(artifactImpl),any(ArtifactData.class),eq(attributeType))).thenReturn(two);
  artifactImpl.add(attributeType,one);
  artifactImpl.setAttributesFromStrings(attributeType,"String_Node_Str","String_Node_Str");
  verify(one).setFromString("String_Node_Str");
  verify(two).setFromString("String_Node_Str");
  reset(one,two);
  when(one.getValue()).thenReturn("String_Node_Str");
  artifactImpl.setAttributesFromStrings(attributeType,"String_Node_Str","String_Node_Str");
  verify(one,never()).setFromString("String_Node_Str");
  verify(two).setFromString("String_Node_Str");
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetAttributesFromStringsCreateOne() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  when(one.getOrcsData()).thenReturn(attributeData);
  when(two.getOrcsData()).thenReturn(attributeData);
  when(attributeType.getMaxOccurrences()).thenReturn(3);
  when(attributeFactory.createAttributeWithDefaults(eq(artifactImpl),any(ArtifactData.class),eq(attributeType))).thenReturn(two);
  artifactImpl.add(attributeType,one);
  artifactImpl.setAttributesFromStrings(attributeType,"String_Node_Str","String_Node_Str");
  verify(one).setFromString("String_Node_Str");
  verify(two).setFromString("String_Node_Str");
  reset(one,two);
  when(one.getValue()).thenReturn("String_Node_Str");
  artifactImpl.setAttributesFromStrings(attributeType,"String_Node_Str","String_Node_Str");
  verify(one,never()).setFromString("String_Node_Str");
  verify(two).setFromString("String_Node_Str");
}
Program: 97548
Project: 97548
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetAttributesFromStringsCreateAll() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  Attribute three=mock(Attribute.class);
  when(attributeType.getMaxOccurrences()).thenReturn(3);
  when(attributeFactory.createAttributeWithDefaults(eq(artifactImpl),any(ArtifactData.class),eq(attributeType))).thenReturn(one,two,three);
  artifactImpl.setAttributesFromStrings(attributeType,"String_Node_Str","String_Node_Str","String_Node_Str");
  verify(one).setFromString("String_Node_Str");
  verify(two).setFromString("String_Node_Str");
  verify(three).setFromString("String_Node_Str");
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetAttributesFromStringsCreateAll() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  Attribute three=mock(Attribute.class);
  when(one.getOrcsData()).thenReturn(attributeData);
  when(two.getOrcsData()).thenReturn(attributeData);
  when(three.getOrcsData()).thenReturn(attributeData);
  when(attributeType.getMaxOccurrences()).thenReturn(3);
  when(attributeFactory.createAttributeWithDefaults(eq(artifactImpl),any(ArtifactData.class),eq(attributeType))).thenReturn(one,two,three);
  artifactImpl.setAttributesFromStrings(attributeType,"String_Node_Str","String_Node_Str","String_Node_Str");
  verify(one).setFromString("String_Node_Str");
  verify(two).setFromString("String_Node_Str");
  verify(three).setFromString("String_Node_Str");
}
Program: 97549
Project: 97549
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testGetName() throws OseeCoreException {
  String name=artifactImpl.getName();
  Assert.assertTrue(name.contains("String_Node_Str"));
  Attribute attr=mock(Attribute.class);
  when(attributeFactory.createAttributeWithDefaults(any(AttributeManager.class),any(ArtifactData.class),eq(CoreAttributeTypes.Name))).thenReturn(attr);
  when(attr.getValue()).thenReturn("String_Node_Str");
  artifactImpl.add(CoreAttributeTypes.Name,attr);
  artifactImpl.setName("String_Node_Str");
  name=artifactImpl.getName();
  Assert.assertEquals("String_Node_Str",name);
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testGetName() throws OseeCoreException {
  String name=artifactImpl.getName();
  Assert.assertTrue(name.contains("String_Node_Str"));
  Attribute attr=mock(Attribute.class);
  when(attr.getOrcsData()).thenReturn(attributeData);
  when(attributeFactory.createAttributeWithDefaults(any(AttributeManager.class),any(ArtifactData.class),eq(CoreAttributeTypes.Name))).thenReturn(attr);
  when(attr.getValue()).thenReturn("String_Node_Str");
  artifactImpl.add(CoreAttributeTypes.Name,attr);
  artifactImpl.setName("String_Node_Str");
  name=artifactImpl.getName();
  Assert.assertEquals("String_Node_Str",name);
}
Program: 97550
Project: 97550
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetAttributesNotDirty(){
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,one);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,two);
  artifactImpl.setAttributesNotDirty();
  verify(one).clearDirty();
  verify(two).clearDirty();
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetAttributesNotDirty(){
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  when(one.getOrcsData()).thenReturn(attributeData);
  when(two.getOrcsData()).thenReturn(attributeData);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,one);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,two);
  artifactImpl.setAttributesNotDirty();
  verify(one).clearDirty();
  verify(two).clearDirty();
}
Program: 97551
Project: 97551
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testGetSoleAttributeAsStringException() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,one);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,two);
  thrown.expect(MultipleAttributesExist.class);
  artifactImpl.getSoleAttributeAsString(CoreAttributeTypes.AccessContextId);
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testGetSoleAttributeAsStringException() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  when(one.getOrcsData()).thenReturn(attributeData);
  when(two.getOrcsData()).thenReturn(attributeData);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,one);
  artifactImpl.add(CoreAttributeTypes.AccessContextId,two);
  thrown.expect(MultipleAttributesExist.class);
  artifactImpl.getSoleAttributeAsString(CoreAttributeTypes.AccessContextId);
}
Program: 97552
Project: 97552
Buggy source:
@Before public void init() throws OseeCoreException {
  MockitoAnnotations.initMocks(this);
  artifactImpl=new ArtifactImpl(artifactData,attributeFactory,relationContainer,branchProvider,artifactTypeProvider);
  when(artifactTypeProvider.get()).thenReturn(artifactType);
  when(artifactType.isValidAttributeType(any(IAttributeType.class),any(Branch.class))).thenReturn(true);
  when(attributeFactory.getAttribeType(any(IAttributeType.class))).thenReturn(attributeType);
  when(attributeType.getMaxOccurrences()).thenReturn(1);
  when(artifactData.getGuid()).thenReturn(guid);
  when(artifactData.getVersion()).thenReturn(version);
  when(branchProvider.get()).thenReturn(branch);
  when(deleted.isDeleted()).thenReturn(true);
}

Fixed version (ground truth):
@Before public void init() throws OseeCoreException {
  MockitoAnnotations.initMocks(this);
  artifactImpl=new ArtifactImpl(artifactData,attributeFactory,relationContainer,branchProvider,artifactTypeProvider);
  when(artifactTypeProvider.get()).thenReturn(artifactType);
  when(artifactType.isValidAttributeType(any(IAttributeType.class),any(Branch.class))).thenReturn(true);
  when(attributeFactory.getAttribeType(any(IAttributeType.class))).thenReturn(attributeType);
  when(attributeFactory.createAttribute(any(AttributeManager.class),any(AttributeData.class))).thenReturn(attribute);
  when(attributeFactory.createAttributeWithDefaults(any(AttributeManager.class),any(ArtifactData.class),any(IAttributeType.class))).thenReturn(attribute);
  when(attribute.getOrcsData()).thenReturn(attributeData);
  when(attributeType.getMaxOccurrences()).thenReturn(1);
  when(artifactData.getGuid()).thenReturn(guid);
  when(artifactData.getVersion()).thenReturn(version);
  when(branchProvider.get()).thenReturn(branch);
  when(deleted.isDeleted()).thenReturn(true);
  when(notDeleted.getOrcsData()).thenReturn(attributeData);
  when(deleted.getOrcsData()).thenReturn(attributeData);
  when(differentType.getOrcsData()).thenReturn(attributeData);
}
Program: 97553
Project: 97553
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testIsDirty() throws OseeCoreException {
  Assert.assertFalse(artifactImpl.isDirty());
  Attribute dirty=mock(Attribute.class);
  when(dirty.isDirty()).thenReturn(true);
  artifactImpl.add(CoreAttributeTypes.Active,dirty);
  Assert.assertTrue(artifactImpl.isDirty());
  reset(dirty);
  Assert.assertFalse(artifactImpl.isDirty());
  artifactImpl.setArtifactType(CoreArtifactTypes.CodeUnit);
  Assert.assertTrue(artifactImpl.isDirty());
  artifactImpl.setOrcsData(artifactData);
  Assert.assertFalse(artifactImpl.isDirty());
  when(artifactData.getModType()).thenReturn(ModificationType.REPLACED_WITH_VERSION);
  Assert.assertTrue(artifactImpl.isDirty());
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testIsDirty() throws OseeCoreException {
  Assert.assertFalse(artifactImpl.isDirty());
  Attribute dirty=mock(Attribute.class);
  when(dirty.getOrcsData()).thenReturn(attributeData);
  when(dirty.isDirty()).thenReturn(true);
  artifactImpl.add(CoreAttributeTypes.Active,dirty);
  Assert.assertTrue(artifactImpl.isDirty());
  reset(dirty);
  Assert.assertFalse(artifactImpl.isDirty());
  artifactImpl.setArtifactType(CoreArtifactTypes.CodeUnit);
  Assert.assertTrue(artifactImpl.isDirty());
  artifactImpl.setOrcsData(artifactData);
  Assert.assertFalse(artifactImpl.isDirty());
  when(artifactData.getModType()).thenReturn(ModificationType.REPLACED_WITH_VERSION);
  Assert.assertTrue(artifactImpl.isDirty());
}
Program: 97554
Project: 97554
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testAddAndGet(){
  Attribute<Object> attribute=mock(Attribute.class);
  Assert.assertEquals(0,artifactImpl.getAllAttributes().size());
  artifactImpl.add(CoreAttributeTypes.City,attribute);
  Assert.assertTrue(artifactImpl.getAllAttributes().contains(attribute));
  Assert.assertEquals(1,artifactImpl.getAllAttributes().size());
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testAddAndGet(){
  Attribute<Object> attribute=mock(Attribute.class);
  when(attribute.getOrcsData()).thenReturn(attributeData);
  Assert.assertEquals(0,artifactImpl.getAllAttributes().size());
  artifactImpl.add(CoreAttributeTypes.City,attribute);
  Assert.assertTrue(artifactImpl.getAllAttributes().contains(attribute));
  Assert.assertEquals(1,artifactImpl.getAllAttributes().size());
}
Program: 97555
Project: 97555
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testAddException() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  when(attributeType.getMaxOccurrences()).thenReturn(1);
  artifactImpl.add(attributeType,one);
  artifactImpl.add(attributeType,two);
  Assert.assertEquals(2,artifactImpl.getAttributes(attributeType).size());
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testAddException() throws OseeCoreException {
  Attribute one=mock(Attribute.class);
  Attribute two=mock(Attribute.class);
  when(one.getOrcsData()).thenReturn(attributeData);
  when(two.getOrcsData()).thenReturn(attributeData);
  when(attributeType.getMaxOccurrences()).thenReturn(1);
  artifactImpl.add(attributeType,one);
  artifactImpl.add(attributeType,two);
  Assert.assertEquals(2,artifactImpl.getAttributes(attributeType).size());
}
Program: 97556
Project: 97556
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testAreAttributesDirty(){
  Attribute<Object> attribute=mock(Attribute.class);
  artifactImpl.add(CoreAttributeTypes.City,attribute);
  Assert.assertFalse(artifactImpl.areAttributesDirty());
  when(attribute.isDirty()).thenReturn(true);
  Assert.assertTrue(artifactImpl.areAttributesDirty());
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testAreAttributesDirty(){
  Attribute<Object> attribute=mock(Attribute.class);
  when(attribute.getOrcsData()).thenReturn(attributeData);
  artifactImpl.add(CoreAttributeTypes.City,attribute);
  Assert.assertFalse(artifactImpl.areAttributesDirty());
  when(attribute.isDirty()).thenReturn(true);
  Assert.assertTrue(artifactImpl.areAttributesDirty());
}
Program: 97557
Project: 97557
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetName() throws OseeCoreException {
  Attribute attr=mock(Attribute.class);
  when(attributeFactory.createAttributeWithDefaults(any(AttributeManager.class),any(ArtifactData.class),eq(CoreAttributeTypes.Name))).thenReturn(attr);
  artifactImpl.setName("String_Node_Str");
  verify(attr).setFromString("String_Node_Str");
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testSetName() throws OseeCoreException {
  Attribute attr=mock(Attribute.class);
  when(attr.getOrcsData()).thenReturn(attributeData);
  when(attributeFactory.createAttributeWithDefaults(any(AttributeManager.class),any(ArtifactData.class),eq(CoreAttributeTypes.Name))).thenReturn(attr);
  artifactImpl.setName("String_Node_Str");
  verify(attr).setFromString("String_Node_Str");
}
Program: 97558
Project: 97558
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testCreateAttributeFromArtifactDataAndType() throws OseeCoreException {
  ArtifactData artifactData=mock(ArtifactData.class);
  VersionData artVersionData=mock(VersionData.class);
  when(dataFactory.create(artifactData,attributeType)).thenReturn(attributeData);
  when(attributeData.getVersion()).thenReturn(attrVersionData);
  when(artifactData.getVersion()).thenReturn(artVersionData);
  when(artVersionData.getBranchId()).thenReturn(45);
  ArgumentCaptor<ResourceNameResolver> resolverCapture=ArgumentCaptor.forClass(ResourceNameResolver.class);
  ArgumentCaptor<WeakReference> refCapture=ArgumentCaptor.forClass(WeakReference.class);
  Attribute<Object> actual=factory.createAttributeWithDefaults(container,artifactData,attributeType);
  verify(dataFactory).create(artifactData,attributeType);
  verify(attrVersionData).setBranchId(45);
  assertTrue(attribute == actual);
  verify(proxy).setResolver(resolverCapture.capture());
  verify(attribute).internalInitialize(refCapture.capture(),eq(attributeData),eq(attributeType),eq(true),eq(true));
  verify(container).add(attributeType,attribute);
  assertEquals(container,refCapture.getValue().get());
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testCreateAttributeFromArtifactDataAndType() throws OseeCoreException {
  ArtifactData artifactData=mock(ArtifactData.class);
  VersionData artVersionData=mock(VersionData.class);
  when(dataFactory.create(artifactData,attributeType)).thenReturn(attributeData);
  when(attributeData.getVersion()).thenReturn(attrVersionData);
  when(artifactData.getVersion()).thenReturn(artVersionData);
  when(artVersionData.getBranchId()).thenReturn(45);
  ArgumentCaptor<ResourceNameResolver> resolverCapture=ArgumentCaptor.forClass(ResourceNameResolver.class);
  ArgumentCaptor<WeakReference> refCapture=ArgumentCaptor.forClass(WeakReference.class);
  Attribute<Object> actual=factory.createAttributeWithDefaults(container,artifactData,attributeType);
  verify(dataFactory).create(artifactData,attributeType);
  assertTrue(attribute == actual);
  verify(proxy).setResolver(resolverCapture.capture());
  verify(attribute).internalInitialize(refCapture.capture(),eq(attributeData),eq(attributeType),eq(true),eq(true));
  verify(container).add(attributeType,attribute);
  assertEquals(container,refCapture.getValue().get());
}
Program: 97559
Project: 97559
Buggy source:
@Test public void testCreate() throws Throwable {
  String expectedName="String_Node_Str";
  when(artifactFactory.createArtifact(branch,artifactType,guid)).thenReturn(artifact);
  ArtifactWriteable actual=factory.create(branch,artifactType,guid,expectedName);
  verify(artifactFactory).createArtifact(branch,artifactType,guid);
  verify(artifact).setName(expectedName);
  assertTrue(actual instanceof ProxyWriteable);
  assertTrue(ProxyUtil.isProxy(actual));
  assertEquals(artifact,factory.getProxiedObject(actual));
}

Fixed version (ground truth):
@Test public void testCreate() throws Throwable {
  String expectedName="String_Node_Str";
  when(artifactFactory.createArtifact(branch,artifactType,guid)).thenReturn(artifact);
  when(artifactFactory.clone(artifact)).thenReturn(otherArtifact);
  ArtifactWriteable actual=factory.create(branch,artifactType,guid,expectedName);
  verify(artifactFactory).createArtifact(branch,artifactType,guid);
  verify(otherArtifact).setName(expectedName);
  verify(artifact,times(0)).setName(expectedName);
  assertTrue(actual instanceof ProxyWriteable);
  assertTrue(ProxyUtil.isProxy(actual));
  assertEquals(otherArtifact,factory.getProxiedObject(actual));
  assertEquals(artifact,factory.getOriginalObject(actual));
}
Program: 97560
Project: 97560
Buggy source:
AttributeData create(HasLocalId parent,IAttributeType attributeType) throws OseeCoreException ;

Fixed version (ground truth):
AttributeData create(ArtifactData parent,IAttributeType attributeType) throws OseeCoreException ;
Program: 97561
Project: 97561
Buggy source:
RelationData createRelationData(IRelationType relationType,HasLocalId parent,HasLocalId aArt,HasLocalId bArt,String rationale) throws OseeCoreException ;

Fixed version (ground truth):
RelationData createRelationData(IRelationType relationType,ArtifactData parent,HasLocalId aArt,HasLocalId bArt,String rationale) throws OseeCoreException ;
Program: 97562
Project: 97562
Buggy source:
public ArtifactImpl copyArtifact(ArtifactImpl source,Collection<? extends IAttributeType> types,IOseeBranch ontoBranch) throws OseeCoreException {
  ArtifactData artifactData=factory.copy(ontoBranch,source.getOrcsData());
  ArtifactImpl copy=createArtifact(artifactData);
  Collection<? extends IAttributeType> typeToCopy=getAllowedTypes(copy,types);
  for (  IAttributeType attributeType : typeToCopy) {
    for (    AttributeReadable<?> attributeSource : source.getAttributes(attributeType)) {
      AttributeData data=getAttributeData(attributeSource);
      Attribute<Object> copyAttribute=attributeFactory.copyAttribute(data,ontoBranch,copy);
      copyAttribute.getOrcsData().setArtifactId(copy.getLocalId());
    }
  }
  copy.setLoaded(true);
  return copy;
}

Fixed version (ground truth):
public ArtifactImpl copyArtifact(ArtifactImpl source,Collection<? extends IAttributeType> types,IOseeBranch ontoBranch) throws OseeCoreException {
  ArtifactData artifactData=factory.copy(ontoBranch,source.getOrcsData());
  ArtifactImpl copy=createArtifact(artifactData);
  Collection<? extends IAttributeType> typeToCopy=getAllowedTypes(copy,types);
  for (  IAttributeType attributeType : typeToCopy) {
    for (    AttributeReadable<?> attributeSource : source.getAttributes(attributeType)) {
      AttributeData data=getAttributeData(attributeSource);
      attributeFactory.copyAttribute(data,ontoBranch,copy);
    }
  }
  copy.setLoaded(true);
  return copy;
}
Program: 97563
Project: 97563
Buggy source:
private <T>Attribute<T> createAttribute(AttributeManager container,AttributeData data,boolean isDirty,boolean createWithDefaults) throws OseeCoreException {
  AttributeType type=cache.getByGuid(data.getTypeUuid());
  Conditions.checkNotNull(type,"String_Node_Str","String_Node_Str",data.getTypeUuid());
  Attribute<T> attribute=classResolver.createAttribute(type);
  DataProxy proxy=data.getDataProxy();
  ResourceNameResolver resolver=createResolver(attribute);
  proxy.setResolver(resolver);
  Reference<AttributeManager> artifactRef=new WeakReference<AttributeManager>(container);
  attribute.internalInitialize(artifactRef,data,type,isDirty,createWithDefaults);
synchronized (container) {
    container.add(type,attribute);
  }
  return attribute;
}

Fixed version (ground truth):
private <T>Attribute<T> createAttribute(AttributeManager container,AttributeData data,boolean isDirty,boolean createWithDefaults) throws OseeCoreException {
  AttributeType type=cache.getByGuid(data.getTypeUuid());
  Conditions.checkNotNull(type,"String_Node_Str","String_Node_Str",data.getTypeUuid());
  Attribute<T> attribute=classResolver.createAttribute(type);
  DataProxy proxy=data.getDataProxy();
  ResourceNameResolver resolver=createResolver(attribute);
  proxy.setResolver(resolver);
  Reference<AttributeManager> artifactRef=new WeakReference<AttributeManager>(container);
  attribute.internalInitialize(artifactRef,data,type,isDirty,createWithDefaults);
  container.add(type,attribute);
  return attribute;
}
Program: 97564
Project: 97564
Buggy source:
public <T>Attribute<T> cloneAttribute(AttributeData source,AttributeManager destinationContainer) throws OseeCoreException {
  AttributeData attributeData=dataFactory.clone(source);
  Attribute<T> destinationAttribute=createAttribute(destinationContainer,attributeData,true,false);
  return destinationAttribute;
}

Fixed version (ground truth):
public <T>Attribute<T> cloneAttribute(AttributeData source,AttributeManager destinationContainer) throws OseeCoreException {
  AttributeData attributeData=dataFactory.clone(source);
  Attribute<T> destinationAttribute=createAttribute(destinationContainer,attributeData,false,false);
  return destinationAttribute;
}
Program: 97565
Project: 97565
Buggy source:
public <T>Attribute<T> createAttributeWithDefaults(AttributeManager container,ArtifactData artifactData,IAttributeType attributeType) throws OseeCoreException {
  AttributeData data=dataFactory.create(artifactData,attributeType);
  VersionData versionData=data.getVersion();
  versionData.setBranchId(artifactData.getVersion().getBranchId());
  return createAttribute(container,data,true,true);
}

Fixed version (ground truth):
public <T>Attribute<T> createAttributeWithDefaults(AttributeManager container,ArtifactData artifactData,IAttributeType attributeType) throws OseeCoreException {
  AttributeData data=dataFactory.create(artifactData,attributeType);
  return createAttribute(container,data,true,true);
}
Program: 97566
Project: 97566
Buggy source:
@Override public synchronized void add(IAttributeType type,Attribute<? extends Object> attribute){
  attributes.addAttribute(type,attribute);
}

Fixed version (ground truth):
@Override public synchronized void add(IAttributeType type,Attribute<? extends Object> attribute){
  attributes.addAttribute(type,attribute);
  attribute.getOrcsData().setArtifactId(getLocalId());
}