nus-yam/ex-repair huggingface dataset:
Program: 97567
Project: 97567
Buggy source:
@Override public void remove(IAttributeType type,Attribute<? extends Object> attribute){
  attributes.removeAttribute(type,attribute);
}

Fixed version (ground truth):
@Override public void remove(IAttributeType type,Attribute<? extends Object> attribute){
  attributes.removeAttribute(type,attribute);
  attribute.getOrcsData().setArtifactId(-1);
}
Program: 97568
Project: 97568
Buggy source:
public ArtifactWriteable create(IOseeBranch branch,IArtifactType artifactType,String guid,String name) throws OseeCoreException {
  ArtifactImpl toProxy=factory.createArtifact(branch,artifactType,guid);
  if (name != null) {
    toProxy.setName(name);
  }
  return createWriteable(toProxy);
}

Fixed version (ground truth):
public ArtifactWriteable create(IOseeBranch branch,IArtifactType artifactType,String guid,String name) throws OseeCoreException {
  ArtifactImpl toProxy=factory.createArtifact(branch,artifactType,guid);
  ArtifactWriteable writeable=createWriteable(toProxy);
  if (name != null) {
    writeable.setName(name);
  }
  return writeable;
}
Program: 97569
Project: 97569
Buggy source:
private static void configureProxyData(URI uri,HostConfiguration config){
  boolean proxyBypass=OseeProperties.getOseeProxyBypassEnabled();
  if (!proxyBypass) {
    if (proxyService == null) {
      BundleContext context=Activator.getBundleContext();
      ServiceReference reference=context.getServiceReference(IProxyService.class.getName());
      proxyService=(IProxyService)context.getService(reference);
      proxyService.addProxyChangeListener(new IProxyChangeListener(){
        @Override public void proxyInfoChanged(        IProxyChangeEvent event){
          proxiedData.clear();
        }
      }
);
    }
    String key=String.format("String_Node_Str",uri.getScheme(),uri.getHost());
    IProxyData[] datas=proxiedData.get(key);
    if (datas == null) {
      datas=proxyService.select(uri);
      proxiedData.put(key,datas);
    }
    for (    IProxyData data : datas) {
      config.setProxy(data.getHost(),data.getPort());
    }
  }
  OseeLog.logf(Activator.class,Level.INFO,"String_Node_Str",requests++,uri.toASCIIString());
}

Fixed version (ground truth):
private static void configureProxyData(URI uri,HostConfiguration config){
  boolean proxyBypass=OseeProperties.getOseeProxyBypassEnabled();
  if (!proxyBypass) {
    if (proxyService == null) {
      BundleContext context=Activator.getBundleContext();
      if (context != null) {
        ServiceReference<IProxyService> reference=context.getServiceReference(IProxyService.class);
        proxyService=context.getService(reference);
      }
      if (proxyService != null) {
        proxyService.addProxyChangeListener(new IProxyChangeListener(){
          @Override public void proxyInfoChanged(          IProxyChangeEvent event){
            proxiedData.clear();
          }
        }
);
      }
    }
    String key=String.format("String_Node_Str",uri.getScheme(),uri.getHost());
    IProxyData[] datas=proxiedData.get(key);
    if (datas == null && proxyService != null) {
      datas=proxyService.select(uri);
      proxiedData.put(key,datas);
    }
    if (datas != null) {
      for (      IProxyData data : datas) {
        config.setProxy(data.getHost(),data.getPort());
      }
    }
  }
  OseeLog.logf(Activator.class,Level.INFO,"String_Node_Str",requests++,uri.toASCIIString());
}
Program: 97571
Project: 97571
Buggy source:
private boolean processArtifacts(ArtifactEvent artifactEvent){
  boolean handledConfigReload=false;
  for (  EventBasicGuidArtifact guidArt : artifactEvent.getArtifacts()) {
    if (configReloadArtifactTypeGuids.contains(guidArt.getArtTypeGuid())) {
      AtsBulkLoad.reloadConfig(false);
      handledConfigReload=true;
      break;
    }
  }
  for (  EventBasicGuidArtifact guidArt : artifactEvent.getArtifacts()) {
    try {
      if (guidArt.is(EventModType.Deleted,EventModType.Purged)) {
        handleTaskCacheForDeletedPurged(guidArt);
      }
      if (guidArt.is(EventModType.Added,EventModType.Modified)) {
        handleTaskCacheForAddedModified(guidArt);
      }
    }
 catch (    OseeCoreException ex) {
      OseeLog.log(Activator.class,Level.SEVERE,ex);
    }
  }
  return handledConfigReload;
}

Fixed version (ground truth):
private boolean processArtifacts(ArtifactEvent artifactEvent){
  boolean handledConfigReload=false;
  for (  EventBasicGuidArtifact guidArt : artifactEvent.getArtifacts()) {
    if (configReloadArtifactTypeGuids.contains(guidArt.getArtTypeGuid())) {
      AtsBulkLoad.reloadConfig(false);
      handledConfigReload=true;
      break;
    }
  }
  for (  EventBasicGuidArtifact guidArt : artifactEvent.getArtifacts()) {
    try {
      if (guidArt.is(EventModType.Deleted,EventModType.Purged)) {
        handleCachesForDeletedPurged(guidArt);
      }
      if (guidArt.is(EventModType.Added,EventModType.Modified)) {
        handleCachesForAddedModified(guidArt);
      }
    }
 catch (    OseeCoreException ex) {
      OseeLog.log(Activator.class,Level.SEVERE,ex);
    }
  }
  return handledConfigReload;
}
Program: 97572
Project: 97572
Buggy source:
public static Collection<TaskArtifact> getTaskArtifacts(AbstractTaskableArtifact sma) throws OseeCoreException {
  Collection<TaskArtifact> tasks=teamTasksCache.get(sma);
  if (tasks == null || containsDeleted(tasks)) {
    tasks=sma.getRelatedArtifacts(AtsRelationTypes.SmaToTask_Task,TaskArtifact.class);
    if (tasks.isEmpty()) {
      return tasks;
    }
    teamTasksCache.put(sma,tasks);
  }
  return tasks;
}

Fixed version (ground truth):
public static Collection<TaskArtifact> getTaskArtifacts(AbstractTaskableArtifact sma) throws OseeCoreException {
  Collection<TaskArtifact> tasks=teamTasksCache.get(sma);
  if (tasks == null || containsDeleted(tasks)) {
    tasks=sma.getRelatedArtifacts(AtsRelationTypes.SmaToTask_Task,TaskArtifact.class);
    teamTasksCache.put(sma,tasks);
  }
  return tasks;
}
Program: 97573
Project: 97573
Buggy source:
public void load(final String name,final Collection<? extends Artifact> arts,final CustomizeData customizeData,TableLoadOption... tableLoadOption){
  Displays.pendInDisplayThread(new Runnable(){
    @Override public void run(){
      worldArts.clear();
      otherArts.clear();
      for (      Artifact art : arts) {
        if (AtsUtil.isAtsArtifact(art)) {
          worldArts.add(art);
        }
 else {
          otherArts.add(art);
        }
      }
      if (customizeData != null && !worldXViewer.getCustomizeMgr().generateCustDataFromTable().equals(customizeData)) {
        setCustomizeData(customizeData);
      }
      if (arts.isEmpty()) {
        setTableTitle("String_Node_Str" + name,true);
      }
 else {
        setTableTitle(name,false);
      }
      worldXViewer.setInput(worldArts);
      worldXViewer.updateStatusLabel();
      if (otherArts.size() > 0 && MessageDialog.openConfirm(Displays.getActiveShell(),"String_Node_Str",otherArts.size() + "String_Node_Str")) {
        RendererManager.openInJob(otherArts,PresentationType.GENERALIZED_EDIT);
      }
      worldXViewer.getTree().setFocus();
    }
  }
);
  iWorldEditor.reflow();
}

Fixed version (ground truth):
public void load(final String name,final Collection<? extends Artifact> arts,final CustomizeData customizeData,TableLoadOption... tableLoadOption){
  Displays.pendInDisplayThread(new Runnable(){
    @Override public void run(){
      worldArts.clear();
      otherArts.clear();
      for (      Artifact art : arts) {
        if (AtsUtil.isAtsArtifact(art)) {
          worldArts.add(art);
        }
 else {
          otherArts.add(art);
        }
      }
      if (customizeData != null && !worldXViewer.getCustomizeMgr().generateCustDataFromTable().equals(customizeData)) {
        setCustomizeData(customizeData);
      }
      if (arts.isEmpty()) {
        setTableTitle("String_Node_Str" + name,true);
      }
 else {
        setTableTitle(name,false);
      }
      try {
        AtsBulkLoad.bulkLoadArtifacts(worldArts);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
      }
      worldXViewer.setInput(worldArts);
      worldXViewer.updateStatusLabel();
      if (otherArts.size() > 0 && MessageDialog.openConfirm(Displays.getActiveShell(),"String_Node_Str",otherArts.size() + "String_Node_Str")) {
        RendererManager.openInJob(otherArts,PresentationType.GENERALIZED_EDIT);
      }
      worldXViewer.getTree().setFocus();
    }
  }
);
  iWorldEditor.reflow();
}
Program: 97575
Project: 97575
Buggy source:
@Override public void load(Collection<Object> objects){
  Set<Artifact> arts=new HashSet<Artifact>();
  for (  Object obj : objects) {
    if (AtsUtil.isAtsArtifact(obj)) {
      arts.add((Artifact)obj);
    }
  }
  setInput(arts);
}

Fixed version (ground truth):
@Override public void load(Collection<Object> objects){
  Set<Artifact> arts=new HashSet<Artifact>();
  for (  Object obj : objects) {
    if (AtsUtil.isAtsArtifact(obj)) {
      arts.add((Artifact)obj);
    }
  }
  try {
    AtsBulkLoad.bulkLoadArtifacts(arts);
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
  setInput(arts);
}
Program: 97576
Project: 97576
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);
    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.internalRemovePurgedBranchFromParent();
  }
  return branch;
}
Program: 97577
Project: 97577
Buggy source:
public static boolean isNumeric(String str){
  return str.matches("String_Node_Str");
}

Fixed version (ground truth):
public static boolean isNumeric(String value){
  boolean result=false;
  if (Strings.isValid(value)) {
    Matcher matcher=NUMERIC_PATTERN.matcher(value);
    result=matcher.matches();
  }
  return result;
}
Program: 97579
Project: 97579
Buggy source:
private void bulkLoadArtifactDeltas(IProgressMonitor monitor,CompositeKeyHashMap<TransactionRecord,Integer,Artifact> bulkLoaded,Collection<ChangeItem> changeItems) throws OseeCoreException {
  checkForCancelledStatus(monitor);
  Set<Integer> artIds=asArtIds(changeItems);
  preloadArtifacts(bulkLoaded,artIds,txDelta.getStartTx(),false);
  if (!txDelta.getStartTx().equals(txDelta.getEndTx())) {
    preloadArtifacts(bulkLoaded,artIds,txDelta.getEndTx(),false);
  }
  if (!txDelta.areOnTheSameBranch()) {
    preloadArtifacts(bulkLoaded,artIds,txDelta.getStartTx().getBranch().getBaseTransaction(),true);
  }
}

Fixed version (ground truth):
private void bulkLoadArtifactDeltas(IProgressMonitor monitor,CompositeKeyHashMap<TransactionRecord,Integer,Artifact> bulkLoaded,Collection<ChangeItem> changeItems) throws OseeCoreException {
  checkForCancelledStatus(monitor);
  Set<Integer> artIds=asArtIds(changeItems);
  preloadArtifacts(bulkLoaded,artIds,txDelta.getStartTx(),txDelta.areOnTheSameBranch());
  if (!txDelta.getStartTx().equals(txDelta.getEndTx())) {
    preloadArtifacts(bulkLoaded,artIds,txDelta.getEndTx(),txDelta.areOnTheSameBranch());
  }
  if (!txDelta.areOnTheSameBranch()) {
    preloadArtifacts(bulkLoaded,artIds,txDelta.getStartTx().getBranch().getBaseTransaction(),true);
  }
}
Program: 97580
Project: 97580
Buggy source:
@SuppressWarnings("String_Node_Str") @org.junit.Test public void testDemoDbInit() throws Exception {
  System.out.println("String_Node_Str");
  String lastAuthenticationProtocol=OseeClientProperties.getAuthenticationProtocol();
  try {
    SevereLoggingMonitor monitorLog=TestUtil.severeLoggingStart();
    OseeLog.registerLoggerListener(monitorLog);
    OseeClientProperties.setAuthenticationProtocol("String_Node_Str");
    DatabaseInitializationOperation.executeWithoutPrompting("String_Node_Str");
    TestUtil.severeLoggingEnd(monitorLog);
    OseeLog.log(DatabaseInitializationOperation.class,Level.INFO,"String_Node_Str");
    wasDbInitSuccessful=true;
  }
  finally {
    OseeClientProperties.setAuthenticationProtocol(lastAuthenticationProtocol);
  }
  if (wasDbInitSuccessful) {
    DemoDbUtil.setDbInitSuccessful(true);
    ClientSessionManager.releaseSession();
    ClientSessionManager.getSession();
    UserManager.releaseUser();
    if (UserManager.getUser().getUserId().equals("String_Node_Str")) {
      throw new OseeStateException("String_Node_Str");
    }
    final String BOOTSTRAP_ART_ID="String_Node_Str";
    User oseeUser=UserManager.getUser(SystemUser.OseeSystem);
    ConnectionHandler.runPreparedUpdate("String_Node_Str" + oseeUser.getArtId() + "String_Node_Str"+ BOOTSTRAP_ART_ID+ "String_Node_Str");
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@org.junit.Test public void testDemoDbInit() throws Exception {
  System.out.println("String_Node_Str");
  String lastAuthenticationProtocol=OseeClientProperties.getAuthenticationProtocol();
  try {
    SevereLoggingMonitor monitorLog=TestUtil.severeLoggingStart();
    OseeLog.registerLoggerListener(monitorLog);
    OseeClientProperties.setAuthenticationProtocol("String_Node_Str");
    DatabaseInitializationOperation.executeWithoutPrompting("String_Node_Str");
    TestUtil.severeLoggingEnd(monitorLog);
    OseeLog.log(DatabaseInitializationOperation.class,Level.INFO,"String_Node_Str");
    wasDbInitSuccessful=true;
  }
  finally {
    OseeClientProperties.setAuthenticationProtocol(lastAuthenticationProtocol);
  }
  if (wasDbInitSuccessful) {
    DemoDbUtil.setDbInitSuccessful(true);
    ClientSessionManager.releaseSession();
    ClientSessionManager.getSession();
    UserManager.releaseUser();
    if (UserManager.getUser().getUserId().equals("String_Node_Str")) {
      throw new OseeStateException("String_Node_Str");
    }
    final String BOOTSTRAP_ART_ID="String_Node_Str";
    User oseeUser=UserManager.getUser(SystemUser.OseeSystem);
    ConnectionHandler.runPreparedUpdate(String.format("String_Node_Str",oseeUser.getArtId(),BOOTSTRAP_ART_ID));
  }
  System.out.println("String_Node_Str");
}
Program: 97581
Project: 97581
Buggy source:
public static DecisionReviewArtifact createNewDecisionReview(TeamWorkFlowArtifact teamArt,ReviewBlockType reviewBlockType,String title,String relatedToState,String description,Collection<IAtsDecisionReviewOption> options,List<? extends IAtsUser> assignees,Date createdDate,IAtsUser createdBy) throws OseeCoreException {
  DecisionReviewArtifact decRev=(DecisionReviewArtifact)ArtifactTypeManager.addArtifact(AtsArtifactTypes.DecisionReview,AtsUtilCore.getAtsBranch(),title);
  decRev.initializeNewStateMachine(assignees,createdDate,createdBy);
  teamArt.addRelation(AtsRelationTypes.TeamWorkflowToReview_Review,decRev);
  if (Strings.isValid(relatedToState)) {
    decRev.setSoleAttributeValue(AtsAttributeTypes.RelatedToState,relatedToState);
  }
  if (Strings.isValid(description)) {
    decRev.setSoleAttributeValue(AtsAttributeTypes.Description,description);
  }
  decRev.setSoleAttributeValue(AtsAttributeTypes.DecisionReviewOptions,getDecisionReviewOptionsString(options));
  if (reviewBlockType != null) {
    decRev.setSoleAttributeFromString(AtsAttributeTypes.ReviewBlocks,reviewBlockType.name());
  }
  return decRev;
}

Fixed version (ground truth):
public static DecisionReviewArtifact createNewDecisionReview(TeamWorkFlowArtifact teamArt,ReviewBlockType reviewBlockType,String title,String relatedToState,String description,Collection<IAtsDecisionReviewOption> options,List<? extends IAtsUser> assignees,Date createdDate,IAtsUser createdBy) throws OseeCoreException {
  DecisionReviewArtifact decRev=(DecisionReviewArtifact)ArtifactTypeManager.addArtifact(AtsArtifactTypes.DecisionReview,AtsUtilCore.getAtsBranch(),title);
  decRev.initializeNewStateMachine(assignees,createdDate,createdBy);
  teamArt.addRelation(AtsRelationTypes.TeamWorkflowToReview_Review,decRev);
  if (Strings.isValid(relatedToState)) {
    decRev.setSoleAttributeValue(AtsAttributeTypes.RelatedToState,relatedToState);
  }
  if (Strings.isValid(description)) {
    decRev.setSoleAttributeValue(AtsAttributeTypes.Description,description);
  }
  decRev.setSoleAttributeValue(AtsAttributeTypes.DecisionReviewOptions,getDecisionReviewOptionsString(options));
  if (reviewBlockType != null) {
    decRev.setSoleAttributeFromString(AtsAttributeTypes.ReviewBlocks,reviewBlockType.name());
  }
  AtsReviewCache.decache(teamArt);
  return decRev;
}
Program: 97582
Project: 97582
Buggy source:
public static PeerToPeerReviewArtifact createNewPeerToPeerReview(TeamWorkFlowArtifact teamArt,String reviewTitle,String againstState,Date createdDate,IAtsUser createdBy,SkynetTransaction transaction) throws OseeCoreException {
  PeerToPeerReviewArtifact peerToPeerRev=(PeerToPeerReviewArtifact)ArtifactTypeManager.addArtifact(AtsArtifactTypes.PeerToPeerReview,AtsUtilCore.getAtsBranch(),reviewTitle == null ? "String_Node_Str" : reviewTitle);
  peerToPeerRev.initializeNewStateMachine(null,new Date(),createdBy);
  if (teamArt != null) {
    teamArt.addRelation(AtsRelationTypes.TeamWorkflowToReview_Review,peerToPeerRev);
    if (againstState != null) {
      peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.RelatedToState,againstState);
    }
  }
  peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.ReviewBlocks,ReviewBlockType.None.name());
  peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.ReviewFormalType,ReviewFormalType.InFormal.name());
  if (transaction != null) {
    peerToPeerRev.persist(transaction);
  }
  return peerToPeerRev;
}

Fixed version (ground truth):
public static PeerToPeerReviewArtifact createNewPeerToPeerReview(TeamWorkFlowArtifact teamArt,String reviewTitle,String againstState,Date createdDate,IAtsUser createdBy,SkynetTransaction transaction) throws OseeCoreException {
  PeerToPeerReviewArtifact peerToPeerRev=(PeerToPeerReviewArtifact)ArtifactTypeManager.addArtifact(AtsArtifactTypes.PeerToPeerReview,AtsUtilCore.getAtsBranch(),reviewTitle == null ? "String_Node_Str" : reviewTitle);
  peerToPeerRev.initializeNewStateMachine(null,new Date(),createdBy);
  if (teamArt != null) {
    teamArt.addRelation(AtsRelationTypes.TeamWorkflowToReview_Review,peerToPeerRev);
    if (againstState != null) {
      peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.RelatedToState,againstState);
    }
  }
  peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.ReviewBlocks,ReviewBlockType.None.name());
  peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.ReviewFormalType,ReviewFormalType.InFormal.name());
  if (transaction != null) {
    peerToPeerRev.persist(transaction);
  }
  AtsReviewCache.decache(teamArt);
  return peerToPeerRev;
}
Program: 97583
Project: 97583
Buggy source:
public static Collection<IAtsVersion> createVersions(XResultData resultData,SkynetTransaction transaction,IAtsTeamDefinition teamDefHoldingVersions,Collection<String> newVersionNames){
  List<IAtsVersion> verArts=new ArrayList<IAtsVersion>();
  for (  String newVer : newVersionNames) {
    if (!Strings.isValid(newVer)) {
      resultData.logError("String_Node_Str");
    }
    for (    IAtsVersion verArt : teamDefHoldingVersions.getVersions()) {
      if (verArt.getName().equals(newVer)) {
        resultData.logError(String.format("String_Node_Str",newVer));
      }
    }
  }
  if (!resultData.isErrors()) {
    try {
      for (      String newVer : newVersionNames) {
        IAtsVersion version=AtsConfigCache.instance.getVersionFactory().createVersion(newVer);
        AtsVersionService.get().setTeamDefinition(version,teamDefHoldingVersions);
        new VersionArtifactStore(version).saveToArtifact(transaction);
      }
    }
 catch (    Exception ex) {
      OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
    }
  }
  return verArts;
}

Fixed version (ground truth):
public static Collection<IAtsVersion> createVersions(XResultData resultData,SkynetTransaction transaction,IAtsTeamDefinition teamDefHoldingVersions,Collection<String> newVersionNames){
  List<IAtsVersion> versions=new ArrayList<IAtsVersion>();
  for (  String newVer : newVersionNames) {
    if (!Strings.isValid(newVer)) {
      resultData.logError("String_Node_Str");
    }
    for (    IAtsVersion verArt : teamDefHoldingVersions.getVersions()) {
      if (verArt.getName().equals(newVer)) {
        resultData.logError(String.format("String_Node_Str",newVer));
      }
    }
  }
  if (!resultData.isErrors()) {
    try {
      for (      String newVer : newVersionNames) {
        IAtsVersion version=AtsConfigCache.instance.getVersionFactory().createVersion(newVer);
        versions.add(version);
        Artifact verArt=new VersionArtifactStore(version).getArtifactOrCreate(transaction);
        AtsVersionService.get().setTeamDefinition(version,teamDefHoldingVersions);
        verArt.persist(transaction);
      }
    }
 catch (    Exception ex) {
      OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
    }
  }
  return versions;
}
Program: 97584
Project: 97584
Buggy source:
@AfterClass public static void cleanUp() throws OseeCoreException {
  Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(topLevel,true));
}

Fixed version (ground truth):
@AfterClass public static void cleanUp() throws OseeCoreException {
  try {
    OseeEventManager.getPreferences().setPendRunning(true);
    Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(topLevel,true));
  }
  finally {
    OseeEventManager.getPreferences().setPendRunning(false);
  }
}
Program: 97586
Project: 97586
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>Collection<T> getCollection(Class<T> clazz,String parameterName) throws OseeArgumentException {
  return getValue(Collection.class,parameterName);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>Collection<T> getCollection(Class<T> clazz,String parameterName) throws OseeArgumentException {
  List<T> results=new ArrayList<T>();
  for (  Object obj : getValue(Collection.class,parameterName)) {
    if (clazz.isInstance(obj)) {
      results.add((T)obj);
    }
  }
  return results;
}
Program: 97587
Project: 97587
Buggy source:
@Override protected void doDelete(HttpServletRequest request,HttpServletResponse response) throws IOException {
  try {
    UnsubscribeRequest data=UnsubscribeRequest.createFromXML(request);
    QueryFactory queryFactory=getOrcsApi().getQueryFactory(null);
    ArtifactReadable authorArtifact=getArtifactById(queryFactory,data.getUserId());
    ArtifactReadable groupArtifact=getArtifactById(queryFactory,data.getGroupId());
    String comment=String.format("String_Node_Str",authorArtifact.getSoleAttributeAsString(CoreAttributeTypes.UserId),groupArtifact.getName());
    GraphReadable readableGraph=orcsApi.getGraph(null);
    TransactionFactory factory=orcsApi.getTransactionFactory(null);
    OrcsTransaction txn=factory.createTransaction(CoreBranches.COMMON,authorArtifact,comment);
    txn.asWriteableGraph(readableGraph).deleteRelation(groupArtifact,CoreRelationTypes.Users_Artifact,authorArtifact);
    txn.commit();
    String message=String.format("String_Node_Str");
    response.setStatus(HttpServletResponse.SC_OK);
    response.setContentType("String_Node_Str");
    response.setContentLength(message.length());
    response.getWriter().append(message);
  }
 catch (  Exception ex) {
    handleError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
@Override protected void doDelete(HttpServletRequest request,HttpServletResponse response) throws IOException {
  try {
    UnsubscribeData data=UnsubscribeParser.createFromXML(request);
    QueryFactory queryFactory=getOrcsApi().getQueryFactory(null);
    ArtifactReadable userArtifact=getArtifactById(queryFactory,data.getUserId());
    ArtifactReadable groupArtifact=getArtifactById(queryFactory,data.getGroupId());
    TransactionFactory factory=orcsApi.getTransactionFactory(null);
    Callable<String> callable=factory.createUnsubscribeTx(userArtifact,groupArtifact);
    String message=callable.call();
    response.setStatus(HttpServletResponse.SC_OK);
    response.setContentType("String_Node_Str");
    response.setContentLength(message.length());
    response.getWriter().append(message);
  }
 catch (  Exception ex) {
    handleError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"String_Node_Str",ex);
  }
}
Program: 97588
Project: 97588
Buggy source:
private String createConfirmationPage(String uri,UnsubscribeRequest data) throws IOException {
  URL url=bundleContext.getBundle().getResource("String_Node_Str");
  InputStream inputStream=null;
  try {
    inputStream=url.openStream();
    String template=Lib.inputStreamToString(inputStream);
    return String.format(template,uri,data.getGroupId(),data.getUserId());
  }
  finally {
    Lib.close(inputStream);
  }
}

Fixed version (ground truth):
private String createConfirmationPage(String uri,UnsubscribeData data) throws IOException {
  URL url=bundleContext.getBundle().getResource("String_Node_Str");
  InputStream inputStream=null;
  try {
    inputStream=url.openStream();
    String template=Lib.inputStreamToString(inputStream);
    return String.format(template,uri,data.getGroupId(),data.getUserId());
  }
  finally {
    Lib.close(inputStream);
  }
}
Program: 97589
Project: 97589
Buggy source:
@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException {
  try {
    String requestUri=request.getRequestURL().toString();
    requestUri=requestUri.replace(request.getPathInfo(),"String_Node_Str");
    UnsubscribeRequest data=UnsubscribeRequest.createFromURI(request);
    String page=createConfirmationPage(requestUri,data);
    response.setStatus(HttpServletResponse.SC_OK);
    response.setContentType("String_Node_Str");
    response.setContentLength(page.length());
    response.getWriter().append(page);
  }
 catch (  Exception ex) {
    handleError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException {
  try {
    String requestUri=request.getRequestURL().toString();
    requestUri=requestUri.replace(request.getPathInfo(),"String_Node_Str");
    UnsubscribeData data=UnsubscribeParser.createFromURI(request);
    String page=createConfirmationPage(requestUri,data);
    response.setStatus(HttpServletResponse.SC_OK);
    response.setContentType("String_Node_Str");
    response.setContentLength(page.length());
    response.getWriter().append(page);
  }
 catch (  Exception ex) {
    handleError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"String_Node_Str",ex);
  }
}
Program: 97590
Project: 97590
Buggy source:
@Test(expected=OseeArgumentException.class) public void testAddState_exception2() throws OseeCoreException {
  WorkStateProviderImpl provider=new WorkStateProviderImpl(new MockWorkStateFactory());
  provider.addState(new WorkStateImpl("String_Node_Str"));
  provider.addState("String_Node_Str",new LinkedList<IAtsUser>(),34,23);
}

Fixed version (ground truth):
@Test public void testAddState_exception2() throws OseeCoreException {
  WorkStateProviderImpl provider=new WorkStateProviderImpl(new MockWorkStateFactory());
  provider.addState(new WorkStateImpl("String_Node_Str"));
  provider.addState("String_Node_Str",new LinkedList<IAtsUser>(),34,23);
}
Program: 97591
Project: 97591
Buggy source:
@Test(expected=OseeArgumentException.class) public void testAddState_exception() throws OseeCoreException {
  WorkStateProviderImpl provider=new WorkStateProviderImpl(new MockWorkStateFactory());
  provider.addState(new WorkStateImpl("String_Node_Str"));
  provider.addState(new WorkStateImpl("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testAddState_exception() throws OseeCoreException {
  WorkStateProviderImpl provider=new WorkStateProviderImpl(new MockWorkStateFactory());
  provider.addState(new WorkStateImpl("String_Node_Str"));
  provider.addState(new WorkStateImpl("String_Node_Str"));
}
Program: 97592
Project: 97592
Buggy source:
@Override public void addState(String name,List<? extends IAtsUser> assignees) throws OseeArgumentException {
  addState(name,assignees,0,0);
}

Fixed version (ground truth):
@Override public void addState(String name,List<? extends IAtsUser> assignees){
  addState(name,assignees,0,0);
}
Program: 97593
Project: 97593
Buggy source:
@Override public void createState(String stateName) throws OseeArgumentException {
  WorkState state=getState(stateName);
  if (state == null) {
    state=factory.createStateData(stateName);
    addState(state);
  }
}

Fixed version (ground truth):
@Override public void createState(String stateName){
  WorkState state=getState(stateName);
  if (state == null) {
    state=factory.createStateData(stateName);
    addState(state);
  }
}
Program: 97595
Project: 97595
Buggy source:
private ArtifactJoinQuery createArtifactIdJoin(IOseeDatabaseService dbService,HasCancellation cancellation,int fetchSize) throws OseeCoreException {
  ArtifactJoinQuery artifactJoin=JoinUtility.createArtifactJoinQuery(dbService);
  for (  AbstractJoinQuery join : queryContext.getJoins()) {
    join.store();
  }
  String query=queryContext.getSql();
  List<Object> params=queryContext.getParameters();
  try {
    checkCancelled(cancellation);
    Integer transactionId=-1;
    IOseeStatement chStmt=dbService.getStatement();
    try {
      chStmt.runPreparedQuery(fetchSize,query,params.toArray());
      while (chStmt.next()) {
        checkCancelled(cancellation);
        Integer artId=chStmt.getInt("String_Node_Str");
        Integer branchId=chStmt.getInt("String_Node_Str");
        if (queryContext.getOptions().isHistorical()) {
          transactionId=chStmt.getInt("String_Node_Str");
        }
        artifactJoin.add(artId,branchId,transactionId);
      }
    }
  finally {
      chStmt.close();
    }
  }
  finally {
    for (    AbstractJoinQuery join : queryContext.getJoins()) {
      join.delete();
    }
  }
  return artifactJoin;
}

Fixed version (ground truth):
private ArtifactJoinQuery createArtifactIdJoin(IOseeDatabaseService dbService,HasCancellation cancellation,int fetchSize) throws OseeCoreException {
  ArtifactJoinQuery artifactJoin=JoinUtility.createArtifactJoinQuery(dbService);
  try {
    for (    AbstractJoinQuery join : queryContext.getJoins()) {
      join.store();
      checkCancelled(cancellation);
    }
    Integer transactionId=-1;
    IOseeStatement chStmt=dbService.getStatement();
    try {
      checkCancelled(cancellation);
      String query=queryContext.getSql();
      List<Object> params=queryContext.getParameters();
      chStmt.runPreparedQuery(fetchSize,query,params.toArray());
      while (chStmt.next()) {
        checkCancelled(cancellation);
        Integer artId=chStmt.getInt("String_Node_Str");
        Integer branchId=chStmt.getInt("String_Node_Str");
        if (queryContext.getOptions().isHistorical()) {
          transactionId=chStmt.getInt("String_Node_Str");
        }
        artifactJoin.add(artId,branchId,transactionId);
        checkCancelled(cancellation);
      }
    }
  finally {
      chStmt.close();
    }
  }
  finally {
    for (    AbstractJoinQuery join : queryContext.getJoins()) {
      try {
        join.delete();
      }
 catch (      OseeCoreException ex) {
      }
    }
  }
  return artifactJoin;
}
Program: 97596
Project: 97596
Buggy source:
public static final String selectNodesText(Node startingNode){
  StringBuffer buffer=new StringBuffer();
  NodeList childNodes=startingNode.getChildNodes();
  for (int i=0; i < childNodes.getLength(); i++) {
    if (childNodes.item(i).getNodeType() == Node.CDATA_SECTION_NODE || childNodes.item(i).getNodeType() == Node.TEXT_NODE) {
      buffer.append(childNodes.item(i).getNodeValue().trim());
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
public static final String selectNodesText(Node startingNode){
  StringBuffer buffer=new StringBuffer();
  NodeList childNodes=startingNode.getChildNodes();
  for (int i=0; i < childNodes.getLength(); i++) {
    Node node=childNodes.item(i);
    if (node.getNodeType() == Node.CDATA_SECTION_NODE || node.getNodeType() == Node.TEXT_NODE) {
      buffer.append(node.getNodeValue().trim());
    }
  }
  return buffer.toString();
}
Program: 97598
Project: 97598
Buggy source:
public void reload(){
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final List<Artifact> artifacts=editor.getAwa().getRelatedArtifactsUnSorted(AtsRelationTypes.Goal_Member);
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            worldComposite.load("String_Node_Str",artifacts,(CustomizeData)null,TableLoadOption.None);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
        return new Status(IStatus.ERROR,Activator.PLUGIN_ID,"String_Node_Str",ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}

Fixed version (ground truth):
public void reload(){
  if (isTableDisposed()) {
    return;
  }
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      if (isTableDisposed()) {
        return Status.OK_STATUS;
      }
      try {
        final List<Artifact> artifacts=editor.getAwa().getRelatedArtifactsUnSorted(AtsRelationTypes.Goal_Member);
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            if (isTableDisposed()) {
              return;
            }
            worldComposite.load("String_Node_Str",artifacts,(CustomizeData)null,TableLoadOption.None);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
        return new Status(IStatus.ERROR,Activator.PLUGIN_ID,"String_Node_Str",ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,false);
}
Program: 97603
Project: 97603
Buggy source:
public void addRelationType(RelationType relationType){
  if (!validRelationTypes.contains(relationType)) {
    validRelationTypes.add(relationType);
  }
}

Fixed version (ground truth):
public void addRelationType(RelationType relationType){
  validRelationTypes.add(relationType);
}
Program: 97604
Project: 97604
Buggy source:
@Override public List<ArtifactReadable> getRelatedArtifacts(ArtifactReadable art,IRelationTypeSide relationTypeSide){
  if (art instanceof MockArtifact) {
    MockArtifact mArt=(MockArtifact)art;
    return (List<ArtifactReadable>)mArt.getRelatedArtifacts(relationTypeSide);
  }
 else {
    return Collections.emptyList();
  }
}

Fixed version (ground truth):
@Override public List<ArtifactReadable> getRelatedArtifacts(ArtifactReadable art,IRelationTypeSide relationTypeSide) throws OseeCoreException {
  if (art instanceof MockArtifact) {
    MockArtifact mArt=(MockArtifact)art;
    RelationsReadable readable=mArt.getRelatedArtifacts(relationTypeSide);
    return readable.getList();
  }
 else {
    return Collections.emptyList();
  }
}
Program: 97605
Project: 97605
Buggy source:
@Override public void refresh(){
  super.refresh();
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true);
}

Fixed version (ground truth):
@Override public void refresh(){
  super.refresh();
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true);
  List<XWidget> widgets=XWidgetUtility.findXWidgetsInControl(composite);
  for (  XWidget xWidget : widgets) {
    if (xWidget.isEditable()) {
      if (xWidget instanceof IArtifactStoredWidget) {
        IArtifactStoredWidget aWidget=(IArtifactStoredWidget)xWidget;
        try {
          aWidget.revert();
        }
 catch (        OseeCoreException ex) {
          OseeLog.log(Activator.class,Level.SEVERE,ex);
        }
      }
    }
  }
}
Program: 97606
Project: 97606
Buggy source:
public void removeWidgetForAttributeType(Collection<? extends IAttributeType> attributeTypes){
  for (  IAttributeType attributeType : attributeTypes) {
    xWidgetsMap.remove(attributeType).dispose();
  }
  refresh();
}

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

Fixed version (ground truth):
public void addWidgetForAttributeType(Collection<IAttributeType> attributeTypes) throws OseeCoreException {
  Artifact artifact=editor.getEditorInput().getArtifact();
  boolean isEditable=!artifact.isReadOnly();
  for (  IAttributeType attributeType : attributeTypes) {
    Composite internalComposite;
    if (DefaultAttributeXWidgetProvider.useMultiLineWidget(attributeType)) {
      internalComposite=createAttributeTypeControlsInSection(composite,attributeType,isEditable,15);
    }
 else {
      internalComposite=createAttributeTypeControls(composite,artifact,attributeType,isEditable,false,20);
    }
    setLabelFonts(internalComposite,FontManager.getDefaultLabelFont());
    HelpUtil.setHelp(internalComposite,OseeHelpContext.ARTIFACT_EDITOR__ATTRIBUTES);
    xWidgetsMap.put(attributeType,internalComposite);
  }
  decorator.refresh();
  getManagedForm().getForm().getBody().layout(true);
}
Program: 97608
Project: 97608
Buggy source:
public void update(){
  if (requiresCreation) {
    if (decoration != null) {
      decoration.dispose();
    }
    decoration=new ControlDecoration(control,position,control.getParent());
    requiresCreation=false;
  }
  if (isVisible()) {
    if (image != null) {
      decoration.setImage(image);
    }
    decoration.setDescriptionText(description);
    decoration.show();
  }
 else {
    decoration.setDescriptionText(null);
    decoration.hide();
  }
}

Fixed version (ground truth):
public void update(){
  if (requiresCreation) {
    if (decoration != null) {
      decoration.dispose();
    }
    decoration=new ControlDecoration(control,position,control.getParent());
    requiresCreation=false;
  }
  if (isVisible()) {
    if (image != null) {
      if (decoration.getControl() != null) {
        decoration.setImage(image);
      }
    }
    decoration.setDescriptionText(description);
    decoration.show();
  }
 else {
    decoration.setDescriptionText(null);
    decoration.hide();
  }
}
Program: 97609
Project: 97609
Buggy source:
private void getChildrenFromWorkDefinitionMatch(Object element,List<Object> items){
  items.addAll(AtsWorkDefinitionService.getService().getStatesOrderedByDefaultToState(((WorkDefinitionMatch)element).getWorkDefinition()));
  items.add(new WrappedPercentWeight(((WorkDefinitionMatch)element).getWorkDefinition()));
  items.add(new WrappedTrace(((WorkDefinitionMatch)element).getTrace()));
}

Fixed version (ground truth):
private void getChildrenFromWorkDefinitionMatch(Object element,List<Object> items){
  items.addAll(AtsWorkDefinitionService.getService().getStatesOrderedByOrdinal(((WorkDefinitionMatch)element).getWorkDefinition()));
  items.add(new WrappedPercentWeight(((WorkDefinitionMatch)element).getWorkDefinition()));
  items.add(new WrappedTrace(((WorkDefinitionMatch)element).getTrace()));
}
Program: 97612
Project: 97612
Buggy source:
private String getFormatStr(IAtsTeamDefinition teamDef) throws OseeCoreException {
  if (teamDef != null) {
    Artifact artifact=new TeamDefinitionArtifactStore(teamDef).getArtifact();
    if (artifact != null) {
      String formatStr=artifact.getSoleAttributeValue(AtsAttributeTypes.ActionDetailsFormat);
      if (Strings.isValid(formatStr)) {
        return formatStr;
      }
    }
    if (teamDef.getParentTeamDef() != null) {
      return getFormatStr(teamDef.getParentTeamDef());
    }
  }
  return null;
}

Fixed version (ground truth):
private String getFormatStr(IAtsTeamDefinition teamDef) throws OseeCoreException {
  if (teamDef != null) {
    Artifact artifact=new TeamDefinitionArtifactStore(teamDef).getArtifact();
    if (artifact != null) {
      String formatStr=artifact.getSoleAttributeValue(AtsAttributeTypes.ActionDetailsFormat,"String_Node_Str");
      if (Strings.isValid(formatStr)) {
        return formatStr;
      }
    }
    if (teamDef.getParentTeamDef() != null) {
      return getFormatStr(teamDef.getParentTeamDef());
    }
  }
  return null;
}
Program: 97613
Project: 97613
Buggy source:
@Override public synchronized InetSocketAddress getRecorderSocketAddress() throws RemoteException {
  if (terminated) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!recorderOutputChannel.isOpen()) {
    throw new RemoteException("String_Node_Str");
  }
  final DatagramSocket socket=recorderOutputChannel.socket();
  return new InetSocketAddress(socket.getLocalAddress(),socket.getLocalPort());
}

Fixed version (ground truth):
@Override public synchronized InetSocketAddress getRecorderSocketAddress() throws RemoteException {
  if (terminated) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (recorderOutputChannel == null) {
    try {
      setupRecorderOutputChannel();
    }
 catch (    Exception ex) {
      throw new RemoteException("String_Node_Str");
    }
  }
  if (!recorderOutputChannel.isOpen()) {
    throw new RemoteException("String_Node_Str");
  }
  final DatagramSocket socket=recorderOutputChannel.socket();
  return new InetSocketAddress(socket.getLocalAddress(),socket.getLocalPort());
}
Program: 97614
Project: 97614
Buggy source:
/** 
 * Constructs a new message manager service
 */
public AbstractMessageToolService(IMessageManager messageManager) throws IOException {
  openXmitChannel();
  recorderOutputChannel=DatagramChannel.open();
  InetSocketAddress address=new InetSocketAddress(InetAddress.getLocalHost(),0);
  try {
    recorderOutputChannel.socket().bind(address);
  }
 catch (  BindException e) {
    throw new IOException("String_Node_Str" + address.toString());
  }
  messageRequestor=messageManager.createMessageRequestor(getClass().getName());
}

Fixed version (ground truth):
/** 
 * Constructs a new message manager service
 */
public AbstractMessageToolService(IMessageManager messageManager) throws IOException {
  openXmitChannel();
  messageRequestor=messageManager.createMessageRequestor(getClass().getName());
}
Program: 97615
Project: 97615
Buggy source:
@Override public void stopRecording() throws RemoteException {
  if (terminated) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (recorder.isRecording()) {
    try {
      recorder.stopRecording(false);
    }
 catch (    IOException e) {
      OseeLog.log(MessageSystemTestEnvironment.class,Level.INFO,"String_Node_Str",e);
      throw new RemoteException("String_Node_Str",e);
    }
    try {
      recorderOutputChannel.disconnect();
    }
 catch (    IOException e) {
      throw new RemoteException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void stopRecording() throws RemoteException {
  if (terminated) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (recorder.isRecording()) {
    try {
      recorder.stopRecording(false);
    }
 catch (    IOException e) {
      OseeLog.log(MessageSystemTestEnvironment.class,Level.INFO,"String_Node_Str",e);
      throw new RemoteException("String_Node_Str",e);
    }
    try {
      recorderOutputChannel.disconnect();
      recorderOutputChannel.close();
      recorderOutputChannel=null;
    }
 catch (    IOException e) {
      throw new RemoteException("String_Node_Str",e);
    }
  }
}
Program: 97617
Project: 97617
Buggy source:
/** 
 * This test Word Edit's are being saved.
 */
@Before public void setUp() throws Exception {
  assertFalse("String_Node_Str",TestUtil.isProductionDb());
  RenderingUtil.setPopupsAllowed(false);
  tearDown();
}

Fixed version (ground truth):
/** 
 * This test Word Edit's are being saved.
 * @throws OseeCoreException
 */
@Before public void setUp() throws Exception {
  Assert.assertFalse("String_Node_Str",TestUtil.isProductionDb());
  RenderingUtil.setPopupsAllowed(false);
  tearDown();
}
Program: 97618
Project: 97618
Buggy source:
private static void writeNewContentAndWaitForSave(Artifact artifact,IFile editFile,String content) throws UnsupportedEncodingException, CoreException, InterruptedException {
  boolean eventBoolean=OseeEventManager.isDisableEvents();
  UpdateArtifactListener listener=new UpdateArtifactListener(EventModType.Modified,artifact);
  OseeEventManager.addListener(listener);
  OseeEventManager.setDisableEvents(false);
  try {
synchronized (listener) {
      editFile.setContents(new ByteArrayInputStream(content.getBytes("String_Node_Str")),IResource.FORCE,new NullProgressMonitor());
      listener.wait(60000);
    }
  }
  finally {
    OseeEventManager.setDisableEvents(eventBoolean);
    OseeEventManager.removeListener(listener);
  }
  Assert.assertTrue("String_Node_Str",listener.wasUpdateReceived());
}

Fixed version (ground truth):
private static void writeNewContentAndWaitForSave(Artifact artifact,IFile editFile,String content) throws UnsupportedEncodingException, CoreException, InterruptedException {
  boolean eventBoolean=OseeEventManager.isDisableEvents();
  UpdateArtifactListener listener=new UpdateArtifactListener(EventModType.Modified,artifact);
  OseeEventManager.addListener(listener);
  OseeEventManager.setDisableEvents(false);
  try {
synchronized (listener) {
      editFile.setContents(new ByteArrayInputStream(content.getBytes("String_Node_Str")),IResource.FORCE,new NullProgressMonitor());
      listener.wait(60000);
    }
  }
  finally {
    OseeEventManager.setDisableEvents(eventBoolean);
    OseeEventManager.removeListener(listener);
  }
}