nus-yam/ex-repair huggingface dataset:
Program: 97384
Project: 97384
Buggy source:
private Collection<String> getTestUnitsHelper(CoverageItem coverageItem,String searchName) throws OseeCoreException {
  ensurePopulated();
  Collection<Integer> entries=itemsToTestUnit.getValues(coverageItem);
  Set<String> names=new LinkedHashSet<String>();
  if (entries != null) {
    for (    Integer entry : entries) {
      if (idToNameCache.containsKey(entry)) {
        String name=idToNameCache.get(entry);
        names.add(Strings.intern(name));
        if (searchName != null && searchName.equals(name)) {
          break;
        }
      }
 else {
        names.add("String_Node_Str");
      }
    }
    return names;
  }
 else {
    return java.util.Collections.emptyList();
  }
}

Fixed version (ground truth):
private Collection<String> getTestUnitsHelper(CoverageItem coverageItem,String searchName) throws OseeCoreException {
  ensurePopulated();
  Collection<Integer> entries=itemsToTestUnit.getValues(coverageItem);
  Set<String> names=new LinkedHashSet<String>();
  Map<Integer,CoverageItem> fails=new HashMap<Integer,CoverageItem>();
  if (entries != null) {
    for (    Integer entry : entries) {
      if (idToNameCache.containsKey(entry)) {
        String name=idToNameCache.get(entry);
        names.add(Strings.intern(name));
        if (searchName != null && searchName.equals(name)) {
          break;
        }
      }
 else {
        names.add(String.format("String_Node_Str",entry));
      }
    }
    return names;
  }
 else {
    return java.util.Collections.emptyList();
  }
}
Program: 97385
Project: 97385
Buggy source:
public static String convertNonPrintableCharacers(String message){
  StringBuilder buff=new StringBuilder(message.length());
  for (int i=0; i < message.length(); i++) {
    char currentChar=message.charAt(i);
    if (currentChar < 32 || currentChar > 126) {
      buff.append("String_Node_Str" + (int)currentChar + "String_Node_Str");
    }
 else     if (currentChar == '<') {
      buff.append("String_Node_Str");
    }
 else     if (currentChar == '>') {
      buff.append("String_Node_Str");
    }
 else     if (currentChar == '&') {
      buff.append("String_Node_Str");
    }
 else {
      buff.append(currentChar);
    }
  }
  return buff.toString();
}

Fixed version (ground truth):
public static String convertNonPrintableCharacers(String message){
  StringBuilder buff=new StringBuilder(message.length());
  for (int i=0; i < message.length(); i++) {
    char currentChar=message.charAt(i);
    if ((currentChar < 32 || currentChar > 126) && currentChar != '\n' && currentChar != '\r' && currentChar != '\t') {
      buff.append("String_Node_Str" + (int)currentChar + "String_Node_Str");
    }
 else     if (currentChar == '<') {
      buff.append("String_Node_Str");
    }
 else     if (currentChar == '>') {
      buff.append("String_Node_Str");
    }
 else     if (currentChar == '&') {
      buff.append("String_Node_Str");
    }
 else {
      buff.append(currentChar);
    }
  }
  return buff.toString();
}
Program: 97386
Project: 97386
Buggy source:
/** 
 * An artifact reflected about its own branch returns itself. Otherwise a new artifact is introduced on the destinationBranch
 * @return the newly created artifact or this artifact if the destinationBranch is this artifact's branch
 */
public final Artifact reflect(IOseeBranch destinationBranch) throws OseeCoreException {
  if (branch.equals(destinationBranch)) {
    return this;
  }
  return reflectHelper(destinationBranch);
}

Fixed version (ground truth):
/** 
 * An artifact reflected about its own branch returns itself. Otherwise a new artifact is introduced on the destinationBranch
 * @return the newly created artifact or this artifact if the destinationBranch is this artifact's branch
 */
public final Artifact reflect(IOseeBranch destinationBranch) throws OseeCoreException {
  return new IntroduceArtifactOperation(destinationBranch).introduce(this);
}
Program: 97387
Project: 97387
Buggy source:
/** 
 * This is used to mark that the artifact deleted.
 */
public final void internalSetDeleted() throws OseeCoreException {
  this.modType=ModificationType.DELETED;
  for (  Attribute<?> attribute : getAttributes()) {
    attribute.setArtifactDeleted();
  }
}

Fixed version (ground truth):
/** 
 * This is used to mark that the artifact deleted.
 */
public final void internalSetDeleted() throws OseeCoreException {
  internalSetModType(ModificationType.DELETED);
  for (  Attribute<?> attribute : getAttributes()) {
    attribute.setArtifactDeleted();
  }
}
Program: 97388
Project: 97388
Buggy source:
/** 
 * artifact.persist(); artifact.reloadAttributesAndRelations(); Will need to be called afterwards to see replaced data in memory
 */
public void replaceWithVersion(int gammaId){
  lastValidModType=this.modType;
  this.modType=ModificationType.REPLACED_WITH_VERSION;
  this.gammaId=gammaId;
}

Fixed version (ground truth):
/** 
 * artifact.persist(); artifact.reloadAttributesAndRelations(); Will need to be called afterwards to see replaced data in memory
 */
public void replaceWithVersion(int gammaId){
  this.gammaId=gammaId;
  internalSetModType(ModificationType.REPLACED_WITH_VERSION);
}
Program: 97389
Project: 97389
Buggy source:
public final List<Artifact> getDescendantsWithArtTypes(Collection<ArtifactType> descendantTypes) throws OseeCoreException {
  List<Artifact> descendants=new LinkedList<Artifact>();
  for (  Artifact child : getChildren()) {
    ArtifactType childArtType=child.getArtifactType();
    if (descendantTypes.contains(childArtType)) {
      descendants.add(child);
    }
    child.getDescendants(descendants);
  }
  return descendants;
}

Fixed version (ground truth):
public List<Artifact> getDescendantsWithArtTypes(Collection<ArtifactType> descendantTypes) throws OseeCoreException {
  List<Artifact> descendants=new LinkedList<Artifact>();
  for (  Artifact child : getChildren()) {
    ArtifactType childArtType=child.getArtifactType();
    if (descendantTypes.contains(childArtType)) {
      descendants.add(child);
    }
    child.getDescendants(descendants,DeletionFlag.EXCLUDE_DELETED);
  }
  return descendants;
}
Program: 97390
Project: 97390
Buggy source:
public static void addRelation(IRelationSorterId sorterId,IRelationType relationTypeToken,Artifact artifactA,Artifact artifactB,String rationale) throws OseeCoreException {
  Conditions.checkExpressionFailOnTrue(artifactA.equals(artifactB),"String_Node_Str",artifactA);
  RelationLink relation=relationCache.getLoadedRelation(artifactA,artifactA.getArtId(),artifactB.getArtId(),relationTypeToken,INCLUDE_DELETED);
  RelationType relationType=RelationTypeManager.getType(relationTypeToken);
  if (relation == null) {
    ensureRelationCanBeAdded(relationTypeToken,artifactA,artifactB);
    relation=getOrCreate(artifactA.getArtId(),artifactB.getArtId(),artifactA.getBranch(),relationType,0,0,rationale,ModificationType.NEW);
    relation.setDirty();
    RelationTypeSideSorter sorter=createTypeSideSorter(artifactA,relationTypeToken,RelationSide.SIDE_B);
    sorter.addItem(sorterId,artifactB);
  }
 else   if (relation.isDeleted()) {
    relation.undelete();
    RelationTypeSideSorter sorter=createTypeSideSorter(artifactA,relationTypeToken,RelationSide.SIDE_B);
    sorter.addItem(sorterId,artifactB);
  }
}

Fixed version (ground truth):
public static void addRelation(IRelationSorterId sorterId,IRelationType relationTypeToken,Artifact artifactA,Artifact artifactB,String rationale) throws OseeCoreException {
  Conditions.checkExpressionFailOnTrue(artifactA.equals(artifactB),"String_Node_Str",artifactA);
  RelationLink relation=relationCache.getLoadedRelation(artifactA,artifactA.getArtId(),artifactB.getArtId(),relationTypeToken,INCLUDE_DELETED);
  RelationType relationType=RelationTypeManager.getType(relationTypeToken);
  if (relation == null) {
    try {
      ensureRelationCanBeAdded(relationTypeToken,artifactA,artifactB);
      relation=getOrCreate(artifactA.getArtId(),artifactB.getArtId(),artifactA.getBranch(),relationType,0,0,rationale,ModificationType.NEW);
      relation.setDirty();
      RelationTypeSideSorter sorter=createTypeSideSorter(artifactA,relationTypeToken,RelationSide.SIDE_B);
      sorter.addItem(sorterId,artifactB);
    }
 catch (    OseeArgumentException e) {
      System.out.println("String_Node_Str" + relation + "String_Node_Str"+ relationTypeToken+ "String_Node_Str"+ artifactA+ "String_Node_Str"+ artifactB+ "String_Node_Str");
    }
  }
 else   if (relation.isDeleted()) {
    relation.undelete();
    RelationTypeSideSorter sorter=createTypeSideSorter(artifactA,relationTypeToken,RelationSide.SIDE_B);
    sorter.addItem(sorterId,artifactB);
  }
}
Program: 97391
Project: 97391
Buggy source:
private File getInputFile() throws IOException {
  File outfile=tempFolder.newFile("String_Node_Str");
  URL url=UtfReadingRuleTest.class.getResource(FILE_INPUT);
  InputStream inputStream=null;
  try {
    inputStream=new BufferedInputStream(url.openStream());
    Lib.inputStreamToFile(inputStream,outfile);
  }
  finally {
    Lib.close(inputStream);
  }
  return outfile;
}

Fixed version (ground truth):
private File getInputFile() throws IOException {
  String copyName=String.format("String_Node_Str",Lib.getDateTimeString());
  File outfile=tempFolder.newFile(copyName);
  URL url=UtfReadingRuleTest.class.getResource(FILE_INPUT);
  InputStream inputStream=null;
  try {
    inputStream=new BufferedInputStream(url.openStream());
    Lib.inputStreamToFile(inputStream,outfile);
  }
  finally {
    Lib.close(inputStream);
  }
  return outfile;
}
Program: 97392
Project: 97392
Buggy source:
@Test public void testCharset(){
  Stack<String> charsetStack=new Stack<String>();
  charsetStack.add("String_Node_Str");
  charsetStack.add("String_Node_Str");
  Utf8TestRule rule=new Utf8TestRule();
  while (!charsetStack.isEmpty()) {
    try {
      File inputFile=getInputFile();
      rule.setCharsetString(charsetStack.pop());
      rule.process(inputFile);
    }
 catch (    Exception ex) {
      Assert.assertTrue("String_Node_Str" + ex.toString(),ex instanceof UnsupportedCharsetException || ex instanceof UnsupportedEncodingException);
    }
  }
}

Fixed version (ground truth):
@Test public void testCharset(){
  Stack<String> charsetStack=new Stack<String>();
  charsetStack.add("String_Node_Str");
  charsetStack.add("String_Node_Str");
  Utf8TestRule rule=new Utf8TestRule();
  while (!charsetStack.isEmpty()) {
    try {
      rule.setCharsetString(charsetStack.pop());
      rule.process(inputFile);
    }
 catch (    Exception ex) {
      Assert.assertTrue("String_Node_Str" + ex.toString(),ex instanceof UnsupportedCharsetException || ex instanceof UnsupportedEncodingException);
    }
  }
}
Program: 97393
Project: 97393
Buggy source:
@Test public void testUtf8ReadData() throws IOException {
  Utf8TestRule rule=new Utf8TestRule();
  try {
    File inputFile=getInputFile();
    rule.process(inputFile);
  }
 catch (  UnsupportedCharsetException ex) {
    Assert.assertTrue(true);
  }
catch (  Exception ex) {
    Assert.fail("String_Node_Str");
  }
  String expectedUtf8String=Lib.fileToString(getClass(),FILE_INPUT);
  String actual=rule.getLastOutput().toString().trim();
  Assert.assertEquals(expectedUtf8String,actual);
}

Fixed version (ground truth):
@Test public void testUtf8ReadData() throws IOException {
  Utf8TestRule rule=new Utf8TestRule();
  try {
    rule.process(inputFile);
  }
 catch (  UnsupportedCharsetException ex) {
    Assert.assertTrue(true);
  }
catch (  Exception ex) {
    Assert.fail("String_Node_Str");
  }
  String expectedUtf8String=Lib.fileToString(getClass(),FILE_INPUT);
  String actual=rule.getLastOutput().toString().trim();
  Assert.assertEquals(expectedUtf8String,actual);
}
Program: 97395
Project: 97395
Buggy source:
public InterArtifactExplorerDropHandlerOperation(Artifact destinationParentArtifact,Artifact[] sourceArtifacts,boolean prompt,boolean recurseChildren,boolean parentToDestinationArtifact){
  super("String_Node_Str",Activator.PLUGIN_ID);
  this.destinationParentArtifact=destinationParentArtifact;
  this.sourceArtifacts=Arrays.asList(sourceArtifacts);
  this.prompt=prompt;
  this.recurseChildren=recurseChildren;
  this.parentToDestinationArtifact=parentToDestinationArtifact;
}

Fixed version (ground truth):
public InterArtifactExplorerDropHandlerOperation(Artifact destinationParentArtifact,Artifact[] sourceArtifacts,boolean prompt){
  super("String_Node_Str",Activator.PLUGIN_ID);
  this.destinationParentArtifact=destinationParentArtifact;
  this.prompt=prompt;
  this.sourceArtifacts=new ArrayList<Artifact>(Arrays.asList(sourceArtifacts));
}
Program: 97397
Project: 97397
Buggy source:
public final Artifact duplicate(IOseeBranch branch,Collection<IAttributeType> excudeAttributeTypes) throws OseeCoreException {
  Artifact newArtifact=ArtifactTypeManager.addArtifact(artifactType,branch);
  newArtifact.attributes.clear();
  copyAttributes(newArtifact,excudeAttributeTypes);
  return newArtifact;
}

Fixed version (ground truth):
public final Artifact duplicate(IOseeBranch branch,IArtifactType newType,Collection<IAttributeType> excudeAttributeTypes) throws OseeCoreException {
  Artifact newArtifact=ArtifactTypeManager.addArtifact(newType,branch);
  newArtifact.attributes.clear();
  copyAttributes(newArtifact,excudeAttributeTypes);
  return newArtifact;
}
Program: 97398
Project: 97398
Buggy source:
private void copyAttributes(Artifact artifact,Collection<IAttributeType> excudeAttributeTypes) throws OseeCoreException {
  for (  Attribute<?> attribute : getAttributes()) {
    if (!excudeAttributeTypes.contains(attribute) && isCopyAllowed(attribute) && artifact.isAttributeTypeValid(attribute.getAttributeType())) {
      artifact.addAttribute(attribute.getAttributeType(),attribute.getValue());
    }
  }
}

Fixed version (ground truth):
private void copyAttributes(Artifact artifact,Collection<IAttributeType> excudeAttributeTypes) throws OseeCoreException {
  for (  Attribute<?> attribute : getAttributes()) {
    if (!excudeAttributeTypes.contains(attribute.getAttributeType()) && isCopyAllowed(attribute) && artifact.isAttributeTypeValid(attribute.getAttributeType())) {
      artifact.addAttribute(attribute.getAttributeType(),attribute.getValue());
    }
  }
}
Program: 97402
Project: 97402
Buggy source:
public synchronized void uninstallBundles(){
  saveAndCloseViews();
  for (  BundleInfoLite info : managedArea.getInstalledBundles()) {
    try {
      info.uninstall();
    }
 catch (    BundleException e) {
      OseeLog.log(WorkspaceBundleLoadCoordinator.class,Level.WARNING,e);
    }
  }
  if (wiring != null) {
    wiring.refreshBundles(null);
  }
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null && workbench.getActiveWorkbenchWindow() != null) {
    IViewRegistry registry=workbench.getViewRegistry();
    forceViewRegistryReload(workbench,registry);
  }
  waitForViewsToBeRegistered(null);
}

Fixed version (ground truth):
public synchronized void uninstallBundles(){
  if (managedArea.getInstalledBundles().size() > 0) {
    saveAndCloseViews();
    for (    BundleInfoLite info : managedArea.getInstalledBundles()) {
      try {
        info.uninstall();
      }
 catch (      BundleException e) {
        OseeLog.log(WorkspaceBundleLoadCoordinator.class,Level.WARNING,e);
      }
    }
    if (wiring != null) {
      wiring.refreshBundles(null);
    }
    IWorkbench workbench=PlatformUI.getWorkbench();
    if (workbench != null && workbench.getActiveWorkbenchWindow() != null) {
      IViewRegistry registry=workbench.getViewRegistry();
      forceViewRegistryReload(workbench,registry);
    }
    waitForViewsToBeRegistered(null);
  }
}
Program: 97403
Project: 97403
Buggy source:
/** 
 * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows with the cache being updated by local and remote events.
 * @param force == true does not used cached value
 */
public static Branch getWorkingBranch(TeamWorkFlowArtifact teamArt,boolean force) throws OseeCoreException {
  long now=new Date().getTime();
  boolean notSet=hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) == null;
  if (notSet || force || (now - hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) > 1000)) {
    hridToWorkingBranchCache.put(teamArt.getHumanReadableId(),getWorkingBranchExcludeStates(teamArt,BranchState.REBASELINED,BranchState.DELETED));
    hridToWorkingBranchCacheUpdated.put(teamArt.getHumanReadableId(),now);
  }
  return hridToWorkingBranchCache.get(teamArt.getHumanReadableId());
}

Fixed version (ground truth):
/** 
 * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows with the cache being updated by local and remote events.
 * @param force == true does not used cached value
 */
public static Branch getWorkingBranch(TeamWorkFlowArtifact teamArt,boolean force) throws OseeCoreException {
  long now=new Date().getTime();
  boolean notSet=hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) == null;
  if (notSet || force || (now - hridToWorkingBranchCacheUpdated.get(teamArt.getHumanReadableId()) > 1000)) {
    hridToWorkingBranchCache.put(teamArt.getHumanReadableId(),getWorkingBranchExcludeStates(teamArt,BranchState.REBASELINED,BranchState.DELETED,BranchState.PURGED,BranchState.COMMIT_IN_PROGRESS,BranchState.CREATION_IN_PROGRESS,BranchState.DELETE_IN_PROGRESS,BranchState.PURGE_IN_PROGRESS));
    hridToWorkingBranchCacheUpdated.put(teamArt.getHumanReadableId(),now);
  }
  return hridToWorkingBranchCache.get(teamArt.getHumanReadableId());
}
Program: 97404
Project: 97404
Buggy source:
private Branch testEvents__purged() throws Exception {
  Branch workingBranch=BranchManager.createWorkingBranch(mainBranch,method.getQualifiedTestName() + "String_Node_Str");
  Assert.assertNotNull(workingBranch);
  final String guid=workingBranch.getGuid();
  Assert.assertNotNull(workingBranch);
  branchEventListener.reset();
  Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(workingBranch,false));
  verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(),BranchEventType.Purging,guid);
  verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(),BranchEventType.Purged,guid);
  Assert.assertEquals(BranchState.CREATED,workingBranch.getBranchState());
  Assert.assertEquals(StorageState.PURGED,workingBranch.getStorageState());
  Assert.assertFalse(workingBranch.isEditable());
  Assert.assertFalse("String_Node_Str",BranchManager.branchExists(guid));
  return workingBranch;
}

Fixed version (ground truth):
private Branch testEvents__purged() throws Exception {
  Branch workingBranch=BranchManager.createWorkingBranch(mainBranch,method.getQualifiedTestName() + "String_Node_Str");
  Assert.assertNotNull(workingBranch);
  final String guid=workingBranch.getGuid();
  Assert.assertNotNull(workingBranch);
  branchEventListener.reset();
  Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(workingBranch,false));
  verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(),BranchEventType.Purging,guid);
  verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(),BranchEventType.Purged,guid);
  Assert.assertEquals(BranchState.PURGED,workingBranch.getBranchState());
  Assert.assertEquals(StorageState.PURGED,workingBranch.getStorageState());
  Assert.assertFalse(workingBranch.isEditable());
  Assert.assertFalse("String_Node_Str",BranchManager.branchExists(guid));
  return workingBranch;
}
Program: 97405
Project: 97405
Buggy source:
@Override public boolean isEditable(){
  BranchState state=getBranchState();
  return !state.isCommitInProgress() && !state.isCommitted() && !state.isRebaselined()&& !state.isDeleted()&& !state.isCreationInProgress()&& !getArchiveState().isArchived()&& !isPurged();
}

Fixed version (ground truth):
@Override public boolean isEditable(){
  BranchState state=getBranchState();
  return (state.isCreated() || state.isModified() || state.isRebaselineInProgress()) && getArchiveState().isUnArchived();
}
Program: 97406
Project: 97406
Buggy source:
public Branch createOrUpdate(IOseeCache<String,Branch> cache,int uniqueId,StorageState storageState,String guid,String name,BranchType branchType,BranchState branchState,boolean isArchived) throws OseeCoreException {
  Conditions.checkNotNull(cache,"String_Node_Str");
  Branch branch=cache.getById(uniqueId);
  if (branch == null) {
    branch=create(guid,name,branchType,branchState,isArchived);
    branch.setId(uniqueId);
    branch.setStorageState(storageState);
  }
 else {
    cache.decache(branch);
    branch.setName(name);
    branch.setArchived(isArchived);
    branch.setBranchState(branchState);
    branch.setBranchType(branchType);
  }
  cache.cache(branch);
  return branch;
}

Fixed version (ground truth):
public Branch createOrUpdate(IOseeCache<String,Branch> cache,int uniqueId,StorageState storageState,String guid,String name,BranchType branchType,BranchState branchState,boolean isArchived) throws OseeCoreException {
  Conditions.checkNotNull(cache,"String_Node_Str");
  Branch branch=cache.getById(uniqueId);
  if (branch == null) {
    branch=create(guid,name,branchType,branchState,isArchived);
    branch.setId(uniqueId);
    branch.setStorageState(storageState);
  }
 else {
    cache.decache(branch);
    branch.setName(name);
    branch.setArchived(isArchived);
    branch.setBranchState(branchState);
    branch.setBranchType(branchType);
    branch.setStorageState(storageState);
  }
  cache.cache(branch);
  return branch;
}
Program: 97407
Project: 97407
Buggy source:
private void storeUpdates(boolean isCompatible,HttpServletRequest req,HttpServletResponse resp) throws OseeCoreException {
  IDataTranslationService service=getTranslationService();
  IOseeCachingService caching=getCachingService();
  TransactionCache txCache=caching.getTransactionCache();
  BranchCacheStoreRequest updateRequest=null;
  InputStream inputStream=null;
  try {
    inputStream=req.getInputStream();
    updateRequest=service.convert(inputStream,CoreTranslatorId.BRANCH_CACHE_STORE_REQUEST);
  }
 catch (  IOException ex) {
    OseeExceptions.wrapAndThrow(ex);
  }
 finally {
    Lib.close(inputStream);
  }
  Collection<Branch> updated=new BranchCacheUpdateUtil(factoryService.getBranchFactory(),txCache).updateCache(updateRequest,caching.getBranchCache());
  BranchCache cache=caching.getBranchCache();
  if (updateRequest.isServerUpdateMessage()) {
    for (    Branch branch : updated) {
      if (StorageState.CREATED == branch.getStorageState()) {
        branch.setStorageState(StorageState.MODIFIED);
      }
      branch.clearDirty();
      cache.decache(branch);
      cache.cache(branch);
    }
  }
 else {
    cache.storeItems(updated);
  }
  try {
    resp.setStatus(HttpServletResponse.SC_ACCEPTED);
    resp.setContentType("String_Node_Str");
    resp.setCharacterEncoding("String_Node_Str");
    resp.getWriter().write("String_Node_Str");
  }
 catch (  IOException ex) {
    OseeExceptions.wrapAndThrow(ex);
  }
}

Fixed version (ground truth):
private void storeUpdates(boolean isCompatible,HttpServletRequest req,HttpServletResponse resp) throws OseeCoreException {
  IDataTranslationService service=getTranslationService();
  IOseeCachingService caching=getCachingService();
  TransactionCache txCache=caching.getTransactionCache();
  BranchCacheStoreRequest updateRequest=null;
  InputStream inputStream=null;
  try {
    inputStream=req.getInputStream();
    updateRequest=service.convert(inputStream,CoreTranslatorId.BRANCH_CACHE_STORE_REQUEST);
  }
 catch (  IOException ex) {
    OseeExceptions.wrapAndThrow(ex);
  }
 finally {
    Lib.close(inputStream);
  }
  Collection<Branch> updated=new BranchCacheUpdateUtil(factoryService.getBranchFactory(),txCache).updateCache(updateRequest,caching.getBranchCache());
  BranchCache cache=caching.getBranchCache();
  if (updateRequest.isServerUpdateMessage()) {
    for (    Branch branch : updated) {
      if (branch.isCreated()) {
        branch.setStorageState(StorageState.MODIFIED);
      }
      branch.clearDirty();
      cache.decache(branch);
      if (!branch.isPurged()) {
        cache.cache(branch);
      }
    }
  }
 else {
    cache.storeItems(updated);
  }
  try {
    resp.setStatus(HttpServletResponse.SC_ACCEPTED);
    resp.setContentType("String_Node_Str");
    resp.setCharacterEncoding("String_Node_Str");
    resp.getWriter().write("String_Node_Str");
  }
 catch (  IOException ex) {
    OseeExceptions.wrapAndThrow(ex);
  }
}
Program: 97408
Project: 97408
Buggy source:
private IdJoinQuery populateBranchIdsJoinIdTable() throws OseeDataStoreException, OseeCoreException {
  IdJoinQuery branchJoin=JoinUtility.createIdJoinQuery();
  BranchFilter branchFilter=new BranchFilter(BranchArchivedState.UNARCHIVED);
  branchFilter.setNegatedBranchStates(BranchState.DELETED);
  for (  Branch branch : BranchManager.getBranches(branchFilter)) {
    branchJoin.add(branch.getId());
  }
  branchJoin.store();
  return branchJoin;
}

Fixed version (ground truth):
private IdJoinQuery populateBranchIdsJoinIdTable() throws OseeDataStoreException, OseeCoreException {
  IdJoinQuery branchJoin=JoinUtility.createIdJoinQuery();
  BranchFilter branchFilter=new BranchFilter(BranchArchivedState.UNARCHIVED);
  branchFilter.setNegatedBranchStates(BranchState.PURGED,BranchState.DELETED);
  for (  Branch branch : BranchManager.getBranches(branchFilter)) {
    branchJoin.add(branch.getId());
  }
  branchJoin.store();
  return branchJoin;
}
Program: 97409
Project: 97409
Buggy source:
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  Branch branch=BranchManager.getBranch(this.branch);
  BranchState originalState=branch.getBranchState();
  BranchArchivedState originalArchivedState=branch.getArchiveState();
  ArtifactCache.deCache(this.branch);
  try {
    branch.setBranchState(BranchState.DELETED);
    branch.setArchived(true);
    OseeEventManager.kickBranchEvent(this,new BranchEvent(BranchEventType.Deleting,branch.getGuid()));
    BranchManager.persist(branch);
  }
 catch (  Exception ex) {
    branch.setBranchState(originalState);
    branch.setArchived(originalArchivedState.isArchived());
    throw ex;
  }
}

Fixed version (ground truth):
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  Branch branch=BranchManager.getBranch(this.branch);
  BranchState originalState=branch.getBranchState();
  BranchArchivedState originalArchivedState=branch.getArchiveState();
  ArtifactCache.deCache(this.branch);
  try {
    branch.setBranchState(BranchState.DELETE_IN_PROGRESS);
    branch.setArchived(true);
    OseeEventManager.kickBranchEvent(this,new BranchEvent(BranchEventType.Deleting,branch.getGuid()));
    BranchManager.persist(branch);
    branch.setBranchState(BranchState.DELETED);
    OseeEventManager.kickBranchEvent(this,new BranchEvent(BranchEventType.Deleted,branch.getGuid()));
    BranchManager.persist(branch);
  }
 catch (  Exception ex) {
    try {
      branch.setBranchState(originalState);
      branch.setArchived(originalArchivedState.isArchived());
      OseeEventManager.kickBranchEvent(this,new BranchEvent(BranchEventType.StateUpdated,branch.getGuid()));
      BranchManager.persist(branch);
    }
 catch (    Exception ex2) {
      log(ex2);
    }
    throw ex;
  }
}
Program: 97410
Project: 97410
Buggy source:
@Override protected void doWork(IProgressMonitor monitor) throws OseeCoreException {
  OseeEventManager.kickBranchEvent(getClass(),new BranchEvent(BranchEventType.Purging,branch.getGuid()));
  PurgeBranchRequest requestData=new PurgeBranchRequest(branch.getId(),recursive);
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",Function.PURGE_BRANCH.name());
  ArtifactCache.deCache(branch);
  AcquireResult response=HttpClientMessage.send(OseeServerContext.BRANCH_CONTEXT,parameters,CoreTranslatorId.PURGE_BRANCH_REQUEST,requestData,null);
  if (response.wasSuccessful()) {
    branch.setStorageState(StorageState.PURGED);
    branch.setArchived(true);
    BranchManager.decache(branch);
    OseeEventManager.kickBranchEvent(getClass(),new BranchEvent(BranchEventType.Purged,branch.getGuid()));
  }
}

Fixed version (ground truth):
@Override protected void doWork(IProgressMonitor monitor) throws OseeCoreException {
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",Function.PURGE_BRANCH.name());
  BranchState currentState=branch.getBranchState();
  BranchArchivedState archivedState=branch.getArchiveState();
  ArtifactCache.deCache(branch);
  branch.setBranchState(BranchState.PURGE_IN_PROGRESS);
  branch.setArchived(true);
  OseeEventManager.kickBranchEvent(getClass(),new BranchEvent(BranchEventType.Purging,branch.getGuid()));
  AcquireResult response=null;
  try {
    PurgeBranchRequest requestData=new PurgeBranchRequest(branch.getId(),recursive);
    response=HttpClientMessage.send(OseeServerContext.BRANCH_CONTEXT,parameters,CoreTranslatorId.PURGE_BRANCH_REQUEST,requestData,null);
  }
 catch (  OseeCoreException ex) {
    try {
      branch.setBranchState(currentState);
      branch.setArchived(archivedState.isArchived());
      OseeEventManager.kickBranchEvent(getClass(),new BranchEvent(BranchEventType.StateUpdated,branch.getGuid()));
    }
 catch (    Exception ex2) {
      log(ex2);
    }
    throw ex;
  }
  if (response.wasSuccessful()) {
    branch.setStorageState(StorageState.PURGED);
    branch.setBranchState(BranchState.PURGED);
    branch.setArchived(true);
    BranchManager.decache(branch);
    BranchManager.getCache().reloadCache();
    OseeEventManager.kickBranchEvent(getClass(),new BranchEvent(BranchEventType.Purged,branch.getGuid()));
  }
}
Program: 97411
Project: 97411
Buggy source:
private void updateBranches(Sender sender,BranchEvent branchEvent){
  BranchEventType eventType=branchEvent.getEventType();
  try {
switch (eventType) {
case Committing:
case CommitFailed:
case Deleting:
case Purging:
      return;
case Committed:
    Branch branch=BranchManager.getBranchByGuid(branchEvent.getBranchGuid());
  Artifact artifact=BranchManager.getAssociatedArtifact(branch);
TransactionManager.clearCommitArtifactCacheForAssociatedArtifact(artifact);
break;
default :
break;
}
BranchManager.refreshBranches();
}
 catch (Exception ex) {
EventUtil.eventLog("String_Node_Str",ex);
}
}

Fixed version (ground truth):
private void updateBranches(Sender sender,BranchEvent branchEvent){
  BranchEventType eventType=branchEvent.getEventType();
  Branch branch=null;
  try {
switch (eventType) {
case Committing:
case CommitFailed:
case Deleting:
case Purging:
      return;
case Committed:
    branch=BranchManager.getBranchByGuid(branchEvent.getBranchGuid());
  Artifact artifact=BranchManager.getAssociatedArtifact(branch);
TransactionManager.clearCommitArtifactCacheForAssociatedArtifact(artifact);
break;
case Purged:
handleBranchRemoval(BranchState.PURGED,branchEvent.getBranchGuid());
break;
case Deleted:
handleBranchRemoval(BranchState.DELETED,branchEvent.getBranchGuid());
break;
default :
break;
}
BranchManager.refreshBranches();
}
 catch (Exception ex) {
EventUtil.eventLog("String_Node_Str",ex);
}
}
Program: 97412
Project: 97412
Buggy source:
private void refreshBranchWarning(){
  Displays.ensureInDisplayThread(new Runnable(){
    @Override public void run(){
      try {
        if (treeViewer == null) {
          return;
        }
        Control control=treeViewer.getTree();
        if (branch != null) {
          String warningStr=null;
          if (!new GlobalMenuPermissions(globalMenuHelper).isBranchReadable(branch)) {
            warningStr="String_Node_Str";
          }
 else {
switch (branch.getBranchState()) {
case CREATION_IN_PROGRESS:
              warningStr="String_Node_Str";
            break;
case COMMIT_IN_PROGRESS:
          warningStr="String_Node_Str";
        break;
case COMMITTED:
      warningStr="String_Node_Str";
    break;
case DELETED:
  warningStr="String_Node_Str";
break;
case REBASELINE_IN_PROGRESS:
warningStr="String_Node_Str";
break;
case REBASELINED:
warningStr="String_Node_Str";
break;
default :
break;
}
}
if (warningStr != null) {
control=branchWarningComposite;
branchWarningLabel.setText(warningStr);
branchWarningLabel.update();
branchWarningComposite.update();
}
}
stackLayout.topControl=control;
stackComposite.layout();
stackComposite.getParent().layout();
}
 catch (OseeCoreException ex) {
OseeLog.log(Activator.class,Level.SEVERE,ex);
}
}
}
);
}

Fixed version (ground truth):
private void refreshBranchWarning(){
  Displays.ensureInDisplayThread(new Runnable(){
    @Override public void run(){
      try {
        if (treeViewer == null) {
          return;
        }
        Control control=treeViewer.getTree();
        if (branch != null) {
          String warningStr=null;
          if (!new GlobalMenuPermissions(globalMenuHelper).isBranchReadable(branch)) {
            warningStr="String_Node_Str";
          }
 else {
switch (branch.getBranchState()) {
case CREATION_IN_PROGRESS:
              warningStr="String_Node_Str";
            break;
case COMMIT_IN_PROGRESS:
          warningStr="String_Node_Str";
        break;
case COMMITTED:
      warningStr="String_Node_Str";
    break;
case DELETED:
  warningStr="String_Node_Str";
break;
case REBASELINE_IN_PROGRESS:
warningStr="String_Node_Str";
break;
case REBASELINED:
warningStr="String_Node_Str";
break;
case DELETE_IN_PROGRESS:
warningStr="String_Node_Str";
break;
case PURGE_IN_PROGRESS:
warningStr="String_Node_Str";
break;
case PURGED:
warningStr="String_Node_Str";
break;
default :
break;
}
}
if (warningStr != null) {
control=branchWarningComposite;
branchWarningLabel.setText(warningStr);
branchWarningLabel.update();
branchWarningComposite.update();
}
}
stackLayout.topControl=control;
stackComposite.layout();
stackComposite.getParent().layout();
}
 catch (OseeCoreException ex) {
OseeLog.log(Activator.class,Level.SEVERE,ex);
}
}
}
);
}
Program: 97415
Project: 97415
Buggy source:
@Override protected Branch handleTxWork(OseeConnection connection) throws OseeCoreException {
  if (branch.getStorageState() != StorageState.PURGED) {
    if (!branch.getAllChildBranches(false).isEmpty()) {
      throw new OseeArgumentException("String_Node_Str",branch.getGuid(),branch.getBranchType());
    }
    int branchId=branch.getId();
    String sql=String.format("String_Node_Str",sourceTableName);
    purgeFromTable(connection,sql,0.20,branchId);
    purgeFromTable(connection,DELETE_FROM_TX_DETAILS,0.09,branchId);
    purgeFromTable(connection,DELETE_FROM_CONFLICT,0.01,branchId);
    if (branch.hasParentBranch()) {
      purgeFromTable(connection,DELETE_FROM_MERGE,0.01,branchId,branch.getParentBranch().getId());
    }
    purgeFromTable(connection,DELETE_FROM_BRANCH_TABLE,0.01,branchId);
    purgeAccessControlTables(branchId);
    branch.setStorageState(StorageState.PURGED);
    branchCache.storeItems(branch);
    branch.internalRemovePurgedBranchFromParent();
  }
  return branch;
}

Fixed version (ground truth):
@Override protected Branch handleTxWork(OseeConnection connection) throws OseeCoreException {
  if (branch.getStorageState() != StorageState.PURGED) {
    if (!branch.getAllChildBranches(false).isEmpty()) {
      throw new OseeArgumentException("String_Node_Str",branch.getGuid(),branch.getBranchType());
    }
    int branchId=branch.getId();
    String sql=String.format("String_Node_Str",sourceTableName);
    purgeFromTable(connection,sql,0.20,branchId);
    purgeFromTable(connection,DELETE_FROM_TX_DETAILS,0.09,branchId);
    purgeFromTable(connection,DELETE_FROM_CONFLICT,0.01,branchId);
    if (branch.hasParentBranch()) {
      purgeFromTable(connection,DELETE_FROM_MERGE,0.01,branchId,branch.getParentBranch().getId());
    }
    purgeFromTable(connection,DELETE_FROM_BRANCH_TABLE,0.01,branchId);
    purgeAccessControlTables(branchId);
    branch.setStorageState(StorageState.PURGED);
    branchCache.storeItems(branch);
    branch.setBranchState(BranchState.PURGED);
    branch.internalRemovePurgedBranchFromParent();
  }
  return branch;
}
Program: 97416
Project: 97416
Buggy source:
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  bundleCoordinator.uninstallBundles();
}

Fixed version (ground truth):
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  IWorkspace workspace=service.getWorkspace();
  workspaceListener=new JarChangeResourceListener<WorkspaceStarterNature>(WorkspaceStarterNature.NATURE_ID,SafeWorkspaceTracker.this);
  try {
    loadBundles(monitor);
  }
 catch (  CoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
  workspace.addResourceChangeListener(workspaceListener);
}
Program: 97417
Project: 97417
Buggy source:
@Override public void loadBundles(IProgressMonitor monitor) throws CoreException {
  for (  WorkspaceStarterNature starterNature : WorkspaceStarterNature.getWorkspaceProjects()) {
    for (    URL url : starterNature.getBundles()) {
      try {
        handleBundleAdded(url);
      }
 catch (      Exception ex) {
        OseeLog.log(SafeWorkspaceTracker.class,Level.INFO,ex);
        ex.printStackTrace();
      }
    }
  }
  SubMonitor master=SubMonitor.convert(monitor,100);
  bundleCoordinator.updateBundles(master.newChild(10));
  bundleCoordinator.installLatestBundles(master.newChild(90));
}

Fixed version (ground truth):
@Override public void loadBundles(IProgressMonitor monitor) throws CoreException {
  for (  WorkspaceStarterNature starterNature : WorkspaceStarterNature.getWorkspaceProjects()) {
    for (    URL url : starterNature.getBundles()) {
      try {
        handleBundleAdded(url);
      }
 catch (      Exception ex) {
        OseeLog.log(SafeWorkspaceTracker.class,Level.INFO,ex);
        ex.printStackTrace();
      }
    }
  }
  bundleCoordinator.updateBundles(monitor);
  bundleCoordinator.installLatestBundles(monitor);
}
Program: 97418
Project: 97418
Buggy source:
@Override public boolean preShutdown(IWorkbench workbench,boolean forced){
  JobComplete jobComplete=new JobComplete();
  IOperation operation=new PrecompileShutdown("String_Node_Str",Activator.BUNDLE_ID);
  Operations.executeAsJob(operation,false,Job.INTERACTIVE,jobComplete);
  for (int i=0; i < 100 && !jobComplete.isDone(); i++) {
    yieldDisplay100ms();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean preShutdown(IWorkbench workbench,boolean forced){
  try {
    bundleCoordinator.uninstallBundles();
  }
 catch (  Throwable th) {
    th.printStackTrace();
  }
  return true;
}
Program: 97423
Project: 97423
Buggy source:
private static ActionArtifact sawBuild2Action4_createUnCommittedConflictedAction(SkynetTransaction transaction) throws OseeCoreException {
  String title="String_Node_Str";
  Collection<IAtsActionableItem> aias=DemoDbUtil.getActionableItems(new String[]{DemoDbAIs.SAW_Requirements.getAIName()});
  Date createdDate=new Date();
  IAtsUser createdBy=AtsUsersClient.getUser();
  String priority="String_Node_Str";
  ActionArtifact actionArt=ActionManager.createAction(null,title,"String_Node_Str",ChangeType.Problem,priority,false,null,aias,createdDate,createdBy,null,transaction);
  for (  TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
    TeamWorkFlowManager dtwm=new TeamWorkFlowManager(teamWf,TransitionOption.OverrideAssigneeCheck,TransitionOption.OverrideTransitionValidityCheck);
    Result result=dtwm.transitionTo(toState,teamWf.getAssignees().iterator().next(),false,transaction);
    if (result.isFalse()) {
      throw new OseeCoreException("String_Node_Str",teamWf.toStringWithId(),toState.getName(),result.getText());
    }
    if (!teamWf.isCompletedOrCancelled()) {
      teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
    }
    teamWf.persist(transaction);
    AtsVersionService.get().setTargetedVersionAndStore(teamWf,version);
    teamWf.persist(transaction);
  }
  return actionArt;
}

Fixed version (ground truth):
private static ActionArtifact sawBuild2Action4_createUnCommittedConflictedAction(SkynetTransaction transaction) throws OseeCoreException {
  String title="String_Node_Str";
  Collection<IAtsActionableItem> aias=DemoDbUtil.getActionableItems(new String[]{DemoDbAIs.SAW_Requirements.getAIName()});
  Date createdDate=new Date();
  IAtsUser createdBy=AtsClientService.get().getUserAdmin().getCurrentUser();
  String priority="String_Node_Str";
  ActionArtifact actionArt=ActionManager.createAction(null,title,"String_Node_Str",ChangeType.Problem,priority,false,null,aias,createdDate,createdBy,null,transaction);
  for (  TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
    TeamWorkFlowManager dtwm=new TeamWorkFlowManager(teamWf,TransitionOption.OverrideAssigneeCheck,TransitionOption.OverrideTransitionValidityCheck);
    Result result=dtwm.transitionTo(toState,teamWf.getAssignees().iterator().next(),false,transaction);
    if (result.isFalse()) {
      throw new OseeCoreException("String_Node_Str",teamWf.toStringWithId(),toState.getName(),result.getText());
    }
    if (!teamWf.isCompletedOrCancelled()) {
      teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
    }
    teamWf.persist(transaction);
    AtsVersionService.get().setTargetedVersionAndStore(teamWf,version);
    teamWf.persist(transaction);
  }
  return actionArt;
}
Program: 97425
Project: 97425
Buggy source:
/** 
 * Create Decision Reviews<br> 1) ALREADY CREATED: Decision review created through the validation flag being set on a workflow<br> 2) Decision in ReWork state w Joe Smith assignee and 2 reviewers<br> 3) Decision in Complete state w Joe Smith assignee and completed<br> <br>
 */
public static void createDecisionReviews(boolean DEBUG,SkynetTransaction transaction) throws Exception {
  Date createdDate=new Date();
  IAtsUser createdBy=AtsUsersClient.getUser();
  if (DEBUG) {
    OseeLog.log(Activator.class,Level.INFO,"String_Node_Str");
  }
  TeamWorkFlowArtifact firstTestArt=getSampleReviewTestWorkflows().get(0);
  TeamWorkFlowArtifact secondTestArt=getSampleReviewTestWorkflows().get(1);
  DecisionReviewArtifact reviewArt=ValidateReviewManager.createValidateReview(firstTestArt,true,createdDate,createdBy,transaction);
  Result result=DecisionReviewManager.transitionTo(reviewArt,DecisionReviewState.Followup,AtsUsersClient.getUser(),false,transaction);
  if (result.isFalse()) {
    throw new IllegalStateException("String_Node_Str" + result.getText());
  }
  reviewArt.persist(transaction);
  reviewArt=ValidateReviewManager.createValidateReview(secondTestArt,true,createdDate,createdBy,transaction);
  DecisionReviewManager.transitionTo(reviewArt,DecisionReviewState.Completed,AtsUsersClient.getUser(),false,transaction);
  if (result.isFalse()) {
    throw new IllegalStateException("String_Node_Str" + result.getText());
  }
  reviewArt.persist(transaction);
}

Fixed version (ground truth):
/** 
 * Create Decision Reviews<br> 1) ALREADY CREATED: Decision review created through the validation flag being set on a workflow<br> 2) Decision in ReWork state w Joe Smith assignee and 2 reviewers<br> 3) Decision in Complete state w Joe Smith assignee and completed<br> <br>
 */
public static void createDecisionReviews(boolean DEBUG,SkynetTransaction transaction) throws Exception {
  Date createdDate=new Date();
  IAtsUser createdBy=AtsClientService.get().getUserAdmin().getCurrentUser();
  if (DEBUG) {
    OseeLog.log(Activator.class,Level.INFO,"String_Node_Str");
  }
  TeamWorkFlowArtifact firstTestArt=getSampleReviewTestWorkflows().get(0);
  TeamWorkFlowArtifact secondTestArt=getSampleReviewTestWorkflows().get(1);
  DecisionReviewArtifact reviewArt=ValidateReviewManager.createValidateReview(firstTestArt,true,createdDate,createdBy,transaction);
  Result result=DecisionReviewManager.transitionTo(reviewArt,DecisionReviewState.Followup,createdBy,false,transaction);
  if (result.isFalse()) {
    throw new IllegalStateException("String_Node_Str" + result.getText());
  }
  reviewArt.persist(transaction);
  reviewArt=ValidateReviewManager.createValidateReview(secondTestArt,true,createdDate,createdBy,transaction);
  DecisionReviewManager.transitionTo(reviewArt,DecisionReviewState.Completed,createdBy,false,transaction);
  if (result.isFalse()) {
    throw new IllegalStateException("String_Node_Str" + result.getText());
  }
  reviewArt.persist(transaction);
}
Program: 97426
Project: 97426
Buggy source:
public static void createTasks(boolean DEBUG) throws Exception {
  if (DEBUG) {
    OseeLog.log(Activator.class,Level.INFO,"String_Node_Str");
  }
  Date createdDate=new Date();
  IAtsUser createdBy=AtsUsersClient.getUser();
  SkynetTransaction transaction=TransactionManager.createTransaction(AtsUtil.getAtsBranch(),"String_Node_Str");
  boolean firstTaskWorkflow=true;
  for (  TeamWorkFlowArtifact codeArt : DemoDbUtil.getSampleCodeWorkflows()) {
    List<IAtsUser> demoUsers=new ArrayList<IAtsUser>();
    if (firstTaskWorkflow) {
      demoUsers.add(AtsUsersClient.getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith)));
      demoUsers.add(AtsUsersClient.getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones)));
    }
 else {
      demoUsers.add(AtsUsersClient.getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith)));
    }
    for (    String title : getTaskTitles(firstTaskWorkflow)) {
      TaskArtifact taskArt=codeArt.createNewTask(demoUsers,title,createdDate,createdBy);
      taskArt.persist(transaction);
    }
    firstTaskWorkflow=false;
  }
  transaction.execute();
}

Fixed version (ground truth):
public static void createTasks(boolean DEBUG) throws Exception {
  if (DEBUG) {
    OseeLog.log(Activator.class,Level.INFO,"String_Node_Str");
  }
  Date createdDate=new Date();
  IAtsUser createdBy=AtsClientService.get().getUserAdmin().getCurrentUser();
  SkynetTransaction transaction=TransactionManager.createTransaction(AtsUtil.getAtsBranch(),"String_Node_Str");
  boolean firstTaskWorkflow=true;
  for (  TeamWorkFlowArtifact codeArt : DemoDbUtil.getSampleCodeWorkflows()) {
    List<IAtsUser> demoUsers=new ArrayList<IAtsUser>();
    if (firstTaskWorkflow) {
      demoUsers.add(AtsClientService.get().getUserAdmin().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith)));
      demoUsers.add(AtsClientService.get().getUserAdmin().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones)));
    }
 else {
      demoUsers.add(AtsClientService.get().getUserAdmin().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith)));
    }
    for (    String title : getTaskTitles(firstTaskWorkflow)) {
      TaskArtifact taskArt=codeArt.createNewTask(demoUsers,title,createdDate,createdBy);
      taskArt.persist(transaction);
    }
    firstTaskWorkflow=false;
  }
  transaction.execute();
}
Program: 97428
Project: 97428
Buggy source:
@Test public void test() throws Exception {
  SevereLoggingMonitor monitor=TestUtil.severeLoggingStart();
  AtsTestUtil.cleanupAndReset(getClass().getSimpleName());
  Assert.assertFalse(AtsUsersClient.getOseeUser().getRelatedArtifacts(AtsRelationTypes.FavoriteUser_Artifact).contains(AtsTestUtil.getTeamWf()));
  FavoriteAction action=createAction();
  action.runWithException();
  Assert.assertTrue(AtsUsersClient.getOseeUser().getRelatedArtifacts(AtsRelationTypes.FavoriteUser_Artifact).contains(AtsTestUtil.getTeamWf()));
  TestUtil.severeLoggingEnd(monitor);
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  SevereLoggingMonitor monitor=TestUtil.severeLoggingStart();
  AtsTestUtil.cleanupAndReset(getClass().getSimpleName());
  Assert.assertFalse(AtsClientService.get().getUserAdmin().getCurrentOseeUser().getRelatedArtifacts(AtsRelationTypes.FavoriteUser_Artifact).contains(AtsTestUtil.getTeamWf()));
  FavoriteAction action=createAction();
  action.runWithException();
  Assert.assertTrue(AtsClientService.get().getUserAdmin().getCurrentOseeUser().getRelatedArtifacts(AtsRelationTypes.FavoriteUser_Artifact).contains(AtsTestUtil.getTeamWf()));
  TestUtil.severeLoggingEnd(monitor);
}