nus-yam/ex-repair huggingface dataset:
Program: 97118
Project: 97118
Buggy source:
/** 
 * Returns non-archived sibling branches that this artifact's attributes have been edited on
 */
private static boolean addBranchesWhereArtifactHasBeenModified(Artifact artifact,Set<String> otherBranches) throws OseeCoreException {
  boolean wasModified=false;
  if (artifact.isInDb()) {
    JdbcStatement chStmt=ConnectionHandler.getStatement();
    try {
      Branch branch=artifact.getFullBranch();
      chStmt.runPreparedQuery(OTHER_EDIT_SQL,artifact.getArtId(),branch.getUuid(),branch.getParentBranch().getUuid(),BranchType.WORKING.getValue());
      while (chStmt.next()) {
        long modifiedOnBranchId=chStmt.getLong("String_Node_Str");
        int modType=chStmt.getInt("String_Node_Str");
        StringBuilder branches=new StringBuilder();
        branches.append("String_Node_Str");
        branches.append("String_Node_Str");
        branches.append(ModificationType.getMod(modType).getDisplayName());
        branches.append("String_Node_Str");
        branches.append(BranchManager.getBranch(modifiedOnBranchId).getShortName(BRANCH_NAME_LENGTH));
        otherBranches.add(branches.toString());
        wasModified=true;
      }
    }
  finally {
      chStmt.close();
    }
  }
  return wasModified;
}

Fixed version (ground truth):
/** 
 * Returns non-archived sibling branches that this artifact's attributes have been edited on
 */
private static boolean addBranchesWhereArtifactHasBeenModified(Artifact artifact,Set<String> otherBranches) throws OseeCoreException {
  boolean wasModified=false;
  if (artifact.isInDb()) {
    JdbcStatement chStmt=ConnectionHandler.getStatement();
    try {
      Branch branch=artifact.getFullBranch();
      chStmt.runPreparedQuery(OTHER_EDIT_SQL,artifact.getArtId(),branch.getUuid(),branch.getParentBranch().getUuid(),BranchType.WORKING.getValue());
      while (chStmt.next()) {
        long modifiedOnBranchId=chStmt.getLong("String_Node_Str");
        int modType=chStmt.getInt("String_Node_Str");
        StringBuilder branches=new StringBuilder();
        branches.append("String_Node_Str");
        branches.append(BranchManager.getBranch(modifiedOnBranchId).getShortName(BRANCH_NAME_LENGTH));
        otherBranches.add(branches.toString());
        wasModified=true;
      }
    }
  finally {
      chStmt.close();
    }
  }
  return wasModified;
}
Program: 97119
Project: 97119
Buggy source:
public ArtifactReadable introduceArtifact(TxData txData,IOseeBranch fromBranch,ArtifactReadable source,ArtifactReadable destination) throws OseeCoreException {
  checkChangesAllowed(txData);
  Artifact src=getSourceArtifact(txData,fromBranch,source);
  Artifact dest=null;
  if (destination == null) {
    dest=artifactFactory.createArtifact(txData.getSession(),txData.getBranch(),src.getArtifactType(),src.getGuid());
    dest.setGraph(loader.createGraph(txData.getSession(),txData.getBranch()));
  }
 else {
    dest=getSourceArtifact(txData,fromBranch,destination);
  }
  artifactFactory.introduceArtifact(txData.getSession(),src,dest,txData.getBranch());
  relationManager.introduce(txData.getSession(),txData.getBranch(),src,dest);
  addNodeAndAdjacencies(txData,dest);
  return asExternalArtifact(txData,dest);
}

Fixed version (ground truth):
public ArtifactReadable introduceArtifact(TxData txData,IOseeBranch fromBranch,ArtifactReadable source,ArtifactReadable destination) throws OseeCoreException {
  checkChangesAllowed(txData);
  Artifact src=getSourceArtifact(txData,fromBranch,source);
  Artifact dest=null;
  if (destination == null) {
    dest=artifactFactory.createArtifact(txData.getSession(),txData.getBranch(),src.getArtifactType(),src.getGuid());
    dest.setGraph(loader.createGraph(txData.getSession(),txData.getBranch()));
  }
 else {
    dest=getSourceArtifact(txData,fromBranch,destination);
  }
  artifactFactory.introduceArtifact(txData.getSession(),src,dest,txData.getBranch());
  relationManager.introduce(txData.getSession(),txData.getBranch(),src,dest);
  addAdjacencies(txData,dest);
  return asExternalArtifact(txData,dest);
}
Program: 97121
Project: 97121
Buggy source:
public void refresh(){
  if (editor != null) {
    for (    SMAWorkFlowSection section : sections) {
      section.dispose();
    }
    refreshData();
  }
}

Fixed version (ground truth):
public void refresh(){
  if (editor != null) {
    if (isXWidgetDirty().isTrue()) {
      saveXWidgetToArtifact();
    }
    for (    SMAWorkFlowSection section : sections) {
      section.dispose();
    }
    refreshData();
  }
}
Program: 97122
Project: 97122
Buggy source:
private void processAttributes(Artifact artifact,WordMLProducer wordMl,PresentationType presentationType,boolean publishInLine,String footer) throws OseeCoreException {
  for (  AttributeElement attributeElement : attributeElements) {
    String attributeName=attributeElement.getAttributeName();
    if (renderer.getBooleanOption(ALL_ATTRIBUTES) || (attributeName.equals("String_Node_Str"))) {
      for (      IAttributeType attributeType : RendererManager.getAttributeTypeOrderList(artifact)) {
        if (!outlining || !attributeType.equals(headingAttributeType)) {
          processAttribute(artifact,wordMl,attributeElement,attributeType,true,presentationType,publishInLine,footer);
        }
      }
    }
 else {
      AttributeType attributeType=AttributeTypeManager.getType(attributeName);
      if (artifact.isAttributeTypeValid(attributeType)) {
        processAttribute(artifact,wordMl,attributeElement,attributeType,false,presentationType,publishInLine,footer);
      }
    }
  }
}

Fixed version (ground truth):
private void processAttributes(Artifact artifact,WordMLProducer wordMl,PresentationType presentationType,boolean publishInLine,String footer) throws OseeCoreException {
  for (  AttributeElement attributeElement : attributeElements) {
    String attributeName=attributeElement.getAttributeName();
    if (renderer.getBooleanOption(ALL_ATTRIBUTES) || (attributeName.equals("String_Node_Str"))) {
      for (      IAttributeType attributeType : RendererManager.getAttributeTypeOrderList(artifact)) {
        if (!outlining || !attributeType.equals(headingAttributeType)) {
          processAttribute(artifact,wordMl,attributeElement,attributeType,true,presentationType,publishInLine,footer);
        }
      }
    }
 else {
      AttributeType attributeType=AttributeTypeManager.getType(attributeName);
      if (artifact.isAttributeTypeValid(attributeType)) {
        processAttribute(artifact,wordMl,attributeElement,attributeType,false,presentationType,publishInLine,footer);
      }
    }
  }
  wordMl.setPageLayout(artifact,footer);
}
Program: 97123
Project: 97123
Buggy source:
public void setTextToClipboard(Collection<String> textTransferData){
  if (textTransferData == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (textTransferData.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  clipboard.setContents(new Object[]{Collections.toString(textTransferData,null,"String_Node_Str",null)},new Transfer[]{TextTransfer.getInstance()});
}

Fixed version (ground truth):
public void setTextToClipboard(Collection<String> textTransferData){
  if (textTransferData == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (textTransferData.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (clipboard.isDisposed()) {
    this.clipboard=new Clipboard(null);
  }
  clipboard.setContents(new Object[]{Collections.toString(textTransferData,null,"String_Node_Str",null)},new Transfer[]{TextTransfer.getInstance()});
}
Program: 97124
Project: 97124
Buggy source:
public void setArtifactsToClipboard(AccessPolicy policyHandlerService,List<Artifact> artifactTransferData) throws OseeCoreException {
  if (artifactTransferData == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (artifactTransferData.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  List<Artifact> authFailedList=new ArrayList<Artifact>(artifactTransferData);
  List<Artifact> authorizedArtifacts=getArtifactsWithPermission(policyHandlerService,PermissionEnum.READ,artifactTransferData);
  authFailedList.removeAll(authorizedArtifacts);
  if (authorizedArtifacts.size() > 0) {
    ArrayList<String> textTransferData=new ArrayList<String>();
    for (    Artifact cur : authorizedArtifacts) {
      textTransferData.add(cur.getName());
    }
    Artifact[] artifacts=authorizedArtifacts.toArray(new Artifact[authorizedArtifacts.size()]);
    clipboard.setContents(new Object[]{new ArtifactData(artifacts,STATUS,viewId),HTMLTransferFormatter.getHtml(artifacts),Collections.toString(textTransferData,null,"String_Node_Str",null)},new Transfer[]{ArtifactTransfer.getInstance(),HTMLTransfer.getInstance(),TextTransfer.getInstance()});
  }
  if (authFailedList.size() > 0) {
    String failed=Collections.toString("String_Node_Str",authFailedList) + "String_Node_Str";
    MessageDialog.openError(Displays.getActiveShell(),"String_Node_Str","String_Node_Str" + failed);
  }
}

Fixed version (ground truth):
public void setArtifactsToClipboard(AccessPolicy policyHandlerService,List<Artifact> artifactTransferData) throws OseeCoreException {
  if (artifactTransferData == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (artifactTransferData.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (clipboard.isDisposed()) {
    this.clipboard=new Clipboard(null);
  }
  List<Artifact> authFailedList=new ArrayList<Artifact>(artifactTransferData);
  List<Artifact> authorizedArtifacts=getArtifactsWithPermission(policyHandlerService,PermissionEnum.READ,artifactTransferData);
  authFailedList.removeAll(authorizedArtifacts);
  if (authorizedArtifacts.size() > 0) {
    ArrayList<String> textTransferData=new ArrayList<String>();
    for (    Artifact cur : authorizedArtifacts) {
      textTransferData.add(cur.getName());
    }
    Artifact[] artifacts=authorizedArtifacts.toArray(new Artifact[authorizedArtifacts.size()]);
    clipboard.setContents(new Object[]{new ArtifactData(artifacts,STATUS,viewId),HTMLTransferFormatter.getHtml(artifacts),Collections.toString(textTransferData,null,"String_Node_Str",null)},new Transfer[]{ArtifactTransfer.getInstance(),HTMLTransfer.getInstance(),TextTransfer.getInstance()});
  }
  if (authFailedList.size() > 0) {
    String failed=Collections.toString("String_Node_Str",authFailedList) + "String_Node_Str";
    MessageDialog.openError(Displays.getActiveShell(),"String_Node_Str","String_Node_Str" + failed);
  }
}
Program: 97125
Project: 97125
Buggy source:
public List<AbstractExportItem> createTaskList(int joinId,PropertyStore options) throws OseeCoreException {
  List<AbstractExportItem> items=new ArrayList<AbstractExportItem>();
  processTxOptions(options);
  int gammaJoinId=createGammaJoin(getDbService(),joinId,options);
  items.add(new ManifestExportItem(logger,preferences,items,options));
  items.add(new MetadataExportItem(logger,items,getMetaData(getDbService())));
  items.add(new OseeTypeModelExportItem(logger,getOrcsTypes()));
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_BRANCH_DATA,BRANCH_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_TX_DETAILS_DATA,TX_DETAILS_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_TXS_DATA,TXS_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_TXS_ARCHIVED_DATA,TXS_ARCHIVE_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_ARTIFACT_DATA,ARTIFACT_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_ATTRIBUTE_DATA,ATTRIBUTE_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_RELATION_LINK_DATA,RELATION_LINK_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_MERGE_DATA,MERGE_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_CONFLICT_DATA,CONFLICT_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_BRANCH_ACL_DATA,BRANCH_ACL_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_ARTIFACT_ACL_DATA,ARTIFACT_ACL_QUERY);
  return items;
}

Fixed version (ground truth):
public List<AbstractExportItem> createTaskList(int joinId,PropertyStore options) throws OseeCoreException {
  List<AbstractExportItem> items=new ArrayList<AbstractExportItem>();
  processTxOptions(options);
  int gammaJoinId=createGammaJoin(getDbService(),joinId,options);
  items.add(new ManifestExportItem(logger,preferences,items,options));
  items.add(new MetadataExportItem(logger,items,getDbService()));
  items.add(new OseeTypeModelExportItem(logger,getOrcsTypes()));
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_BRANCH_DATA,BRANCH_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_TX_DETAILS_DATA,TX_DETAILS_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_TXS_DATA,TXS_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_TXS_ARCHIVED_DATA,TXS_ARCHIVE_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_ARTIFACT_DATA,ARTIFACT_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_ATTRIBUTE_DATA,ATTRIBUTE_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_RELATION_LINK_DATA,RELATION_LINK_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_MERGE_DATA,MERGE_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_CONFLICT_DATA,CONFLICT_TABLE_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_BRANCH_ACL_DATA,BRANCH_ACL_QUERY);
  addItem(items,joinId,options,gammaJoinId,ExportItem.OSEE_ARTIFACT_ACL_DATA,ARTIFACT_ACL_QUERY);
  return items;
}
Program: 97126
Project: 97126
Buggy source:
public MetadataExportItem(Log logger,List<AbstractExportItem> exportItems,DatabaseMetaData metaData){
  super(logger,ExportItem.EXPORT_DB_SCHEMA);
  this.exportItems=exportItems;
  this.metaData=metaData;
}

Fixed version (ground truth):
public MetadataExportItem(Log logger,List<AbstractExportItem> exportItems,JdbcClient jdbcClient){
  super(logger,ExportItem.EXPORT_DB_SCHEMA);
  this.exportItems=exportItems;
  this.jdbcClient=jdbcClient;
}
Program: 97127
Project: 97127
Buggy source:
@Override protected void doWork(Appendable appendable) throws Exception {
  ExportImportXml.openXmlNode(appendable,ExportImportXml.METADATA);
  try {
    String[] tableTypes=getTypes(metaData);
    String schema=getSchema(metaData);
    for (    AbstractExportItem item : exportItems) {
      if (!item.equals(this) && Strings.isValid(item.getSource())) {
        processMetaData(appendable,metaData,schema,tableTypes,item.getSource());
      }
    }
  }
  finally {
    ExportImportXml.closeXmlNode(appendable,ExportImportXml.METADATA);
  }
}

Fixed version (ground truth):
@Override protected void doWork(Appendable appendable) throws Exception {
  ExportImportXml.openXmlNode(appendable,ExportImportXml.METADATA);
  try {
    JdbcConnection connection=jdbcClient.getConnection();
    try {
      DatabaseMetaData metaData=connection.getMetaData();
      String[] tableTypes=getTypes(metaData);
      String schema=getSchema(metaData);
      for (      AbstractExportItem item : exportItems) {
        if (!item.equals(this) && Strings.isValid(item.getSource())) {
          processMetaData(appendable,metaData,schema,tableTypes,item.getSource());
        }
      }
    }
  finally {
      connection.close();
    }
  }
  finally {
    ExportImportXml.closeXmlNode(appendable,ExportImportXml.METADATA);
  }
}
Program: 97128
Project: 97128
Buggy source:
public int getId(){
  return (Integer)backingData.get(BRANCH_ID);
}

Fixed version (ground truth):
public long getId(){
  return asLong(backingData.get(BRANCH_ID));
}
Program: 97129
Project: 97129
Buggy source:
public void setParentBranchId(int nextSeqVal){
  this.backingData.put(PARENT_BRANCH_ID,nextSeqVal);
}

Fixed version (ground truth):
public void setParentBranchId(long nextSeqVal){
  this.backingData.put(PARENT_BRANCH_ID,nextSeqVal);
}
Program: 97130
Project: 97130
Buggy source:
public void setBranchId(int nextSeqVal){
  this.backingData.put(BRANCH_ID,nextSeqVal);
}

Fixed version (ground truth):
public void setBranchId(long nextSeqVal){
  this.backingData.put(BRANCH_ID,nextSeqVal);
}
Program: 97131
Project: 97131
Buggy source:
public int getParentBranchId(){
  return (Integer)backingData.get(PARENT_BRANCH_ID);
}

Fixed version (ground truth):
public long getParentBranchId(){
  return asLong(backingData.get(PARENT_BRANCH_ID));
}
Program: 97132
Project: 97132
Buggy source:
private BranchDataSaxHandler(Log logger,JdbcClient service,boolean isCacheAll,int cacheLimit){
  super(logger,service,isCacheAll,cacheLimit);
  this.idToImportFileBranchData=new HashMap<Integer,BranchData>();
  this.connection=null;
}

Fixed version (ground truth):
private BranchDataSaxHandler(Log logger,JdbcClient service,boolean isCacheAll,int cacheLimit){
  super(logger,service,isCacheAll,cacheLimit);
  this.idToImportFileBranchData=new HashMap<Long,BranchData>();
  this.connection=null;
}
Program: 97133
Project: 97133
Buggy source:
private Collection<BranchData> checkTargetDbBranches(JdbcConnection connection,Collection<BranchData> selectedBranches) throws OseeCoreException {
  Map<String,BranchData> guidToImportFileBranchData=new HashMap<String,BranchData>();
  for (  BranchData data : selectedBranches) {
    guidToImportFileBranchData.put(data.getBranchGuid(),data);
  }
  JdbcStatement chStmt=getDatabaseService().getStatement(connection);
  try {
    chStmt.runPreparedQuery("String_Node_Str");
    while (chStmt.next()) {
      String branchGuid=chStmt.getString(BranchData.BRANCH_GUID);
      Long branchUuid=chStmt.getLong(BranchData.BRANCH_ID);
      BranchData branchData=guidToImportFileBranchData.get(branchGuid);
      if (branchData != null) {
        getTranslator().checkIdMapping("String_Node_Str",(long)branchData.getId(),branchUuid);
        guidToImportFileBranchData.remove(branchGuid);
      }
    }
  }
  finally {
    chStmt.close();
  }
  return guidToImportFileBranchData.values();
}

Fixed version (ground truth):
private Collection<BranchData> checkTargetDbBranches(JdbcConnection connection,Collection<BranchData> selectedBranches) throws OseeCoreException {
  Map<Long,BranchData> idToBranchData=new HashMap<Long,BranchData>();
  for (  BranchData data : selectedBranches) {
    idToBranchData.put(data.getId(),data);
  }
  JdbcStatement chStmt=getDatabaseService().getStatement(connection);
  try {
    chStmt.runPreparedQuery("String_Node_Str");
    while (chStmt.next()) {
      Long branchUuid=chStmt.getLong(BranchData.BRANCH_ID);
      BranchData branchData=idToBranchData.get(branchUuid);
      if (branchData != null) {
        getTranslator().checkIdMapping("String_Node_Str",branchData.getId(),branchUuid);
        idToBranchData.remove(branchUuid);
      }
    }
  }
  finally {
    chStmt.close();
  }
  return idToBranchData.values();
}
Program: 97134
Project: 97134
Buggy source:
public void updateBaselineAndParentTransactionId(long[] branchesStored) throws OseeCoreException {
  List<BranchData> branches=getSelectedBranchesToImport(branchesStored);
  List<Object[]> data=new ArrayList<Object[]>();
  for (  BranchData branchData : branches) {
    int branchUuid=branchData.getId();
    int parentTransactionId=translateId(ExchangeDb.TRANSACTION_ID,branchData.getParentTransactionId());
    if (parentTransactionId == 0) {
      parentTransactionId=1;
    }
    int baselineTransactionId=translateId(ExchangeDb.TRANSACTION_ID,branchData.getBaselineTransactionId());
    if (baselineTransactionId == 0) {
      baselineTransactionId=1;
    }
    data.add(new Object[]{parentTransactionId,baselineTransactionId,branchUuid});
  }
  if (!data.isEmpty()) {
    String query="String_Node_Str";
    int updateCount=getDatabaseService().runBatchUpdate(query,data);
    getLogger().info("String_Node_Str",updateCount,Arrays.toString(branchesStored));
  }
 else {
    getLogger().info("String_Node_Str",Arrays.toString(branchesStored));
  }
}

Fixed version (ground truth):
public void updateBaselineAndParentTransactionId(long[] branchesStored) throws OseeCoreException {
  List<BranchData> branches=getSelectedBranchesToImport(branchesStored);
  List<Object[]> data=new ArrayList<Object[]>();
  for (  BranchData branchData : branches) {
    long branchUuid=branchData.getId();
    int parentTransactionId=translateIntId(ExchangeDb.TRANSACTION_ID,branchData.getParentTransactionId());
    if (parentTransactionId == 0) {
      parentTransactionId=1;
    }
    int baselineTransactionId=translateIntId(ExchangeDb.TRANSACTION_ID,branchData.getBaselineTransactionId());
    if (baselineTransactionId == 0) {
      baselineTransactionId=1;
    }
    data.add(new Object[]{parentTransactionId,baselineTransactionId,branchUuid});
  }
  if (!data.isEmpty()) {
    String query="String_Node_Str";
    int updateCount=getDatabaseService().runBatchUpdate(query,data);
    getLogger().info("String_Node_Str",updateCount,Arrays.toString(branchesStored));
  }
 else {
    getLogger().info("String_Node_Str",Arrays.toString(branchesStored));
  }
}
Program: 97135
Project: 97135
Buggy source:
private Object[] buildSetData(){
  Object[] data=new Object[values.length];
  for (int i=0; i < values.length; ++i) {
    Map<String,Object> element=new HashMap<String,Object>();
    element.put("String_Node_Str",values[i]);
    element.put(innerName[0],innerName[1]);
    Set<Map<String,Object>> dataset=new LinkedHashSet<Map<String,Object>>();
    dataset.add(element);
    data[i]=dataset;
  }
  return data;
}

Fixed version (ground truth):
private Object[] buildSetData(){
  Object[] data=new Object[values.length];
  for (int i=0; i < values.length; ++i) {
    Map<String,Object> element=new LinkedHashMap<String,Object>();
    element.put("String_Node_Str",values[i]);
    element.put(innerName[0],innerName[1]);
    Set<Map<String,Object>> dataset=new LinkedHashSet<Map<String,Object>>();
    dataset.add(element);
    data[i]=dataset;
  }
  return data;
}
Program: 97136
Project: 97136
Buggy source:
@Test public void testSetData(){
  buildTestStructure(buildSetData(),false);
  buildResultData(context);
  String result=resultBuffer.toString();
  assertTrue(countCells(result) == headings.length);
  for (int i=0; i < values.length; ++i) {
    assertTrue(result.contains("String_Node_Str" + values[i]));
  }
}

Fixed version (ground truth):
@Test public void testSetData(){
  buildTestStructure(buildSetData(),false);
  buildResultData(context);
  String result=resultBuffer.toString();
  assertTrue(countCells(result) == headings.length);
  assertTrue(result.contains(innerName[1]));
  for (int i=0; i < values.length; ++i) {
    assertTrue(result.contains(values[i]));
  }
}
Program: 97137
Project: 97137
Buggy source:
@Before public void setup(){
  MockitoAnnotations.initMocks(this);
  when(context.getAttribute(OUTPUT_DEBUG)).thenAnswer(answer("String_Node_Str"));
  when(context.getAttribute(OUTPUT_SCRIPT)).thenAnswer(answer("String_Node_Str"));
  when(context.getWriter()).thenAnswer(answer(resultBuffer));
}

Fixed version (ground truth):
@Before public void setup(){
  MockitoAnnotations.initMocks(this);
  top=new LinkedHashMap<String,Object>();
  resultBuffer=new StringWriter();
  when(context.getAttribute(OUTPUT_DEBUG)).thenAnswer(answer("String_Node_Str"));
  when(context.getAttribute(OUTPUT_SCRIPT)).thenAnswer(answer("String_Node_Str"));
  when(context.getWriter()).thenAnswer(answer(resultBuffer));
}
Program: 97138
Project: 97138
Buggy source:
private void buildTestStructure(Object[] data,boolean deeper){
  Map<String,Object> groupContainer=new HashMap<String,Object>();
  for (int j=groups.length - 1; j >= 0; --j) {
    Map<String,Object> inner=new HashMap<String,Object>();
    for (int i=headings.length - 1; i >= 0; --i) {
      if (i == 2 && deeper) {
        Map<String,Object> bottom=new HashMap<String,Object>();
        bottom.put(innerName[0],data[i]);
        inner.put(headings[i],bottom);
      }
 else {
        inner.put(headings[i],data[i]);
      }
    }
    groupContainer.put(groups[j],inner);
  }
  top.put("String_Node_Str",groupContainer);
}

Fixed version (ground truth):
private void buildTestStructure(Object[] data,boolean deeper){
  Map<String,Object> groupContainer=new LinkedHashMap<String,Object>();
  for (int j=groups.length - 1; j >= 0; --j) {
    Map<String,Object> inner=new LinkedHashMap<String,Object>();
    for (int i=headings.length - 1; i >= 0; --i) {
      if (i == 2 && deeper) {
        Map<String,Object> bottom=new LinkedHashMap<String,Object>();
        bottom.put(innerName[0],data[i]);
        inner.put(headings[i],bottom);
      }
 else {
        inner.put(headings[i],data[i]);
      }
    }
    groupContainer.put(groups[j],inner);
  }
  top.put("String_Node_Str",groupContainer);
}
Program: 97139
Project: 97139
Buggy source:
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  OseeClient client=ServiceUtil.getOseeClient();
  TransactionEndpoint txEndpoint=client.getTransactionEndpoint();
  DeleteTransaction deleteTxs=new DeleteTransaction();
  deleteTxs.setTransactions(txIdsToDelete);
  try {
    Response result=txEndpoint.deleteTxs(deleteTxs);
    if (Status.OK.getStatusCode() == result.getStatus()) {
      for (      PurgeTransactionListener listener : listeners) {
        listener.onPurgeTransactionSuccess(changedTransactions);
      }
    }
  }
 catch (  Exception ex) {
    throw JaxRsExceptions.asOseeException(ex);
  }
}

Fixed version (ground truth):
@Override protected void doWork(IProgressMonitor monitor) throws Exception {
  OseeClient client=ServiceUtil.getOseeClient();
  TransactionEndpoint txEndpoint=client.getTransactionEndpoint();
  String deleteTxs=Collections.toString("String_Node_Str",txIdsToDelete);
  try {
    Response result=txEndpoint.purgeTxs(deleteTxs);
    if (Status.OK.getStatusCode() == result.getStatus()) {
      for (      PurgeTransactionListener listener : listeners) {
        listener.onPurgeTransactionSuccess(changedTransactions);
      }
    }
  }
 catch (  Exception ex) {
    throw JaxRsExceptions.asOseeException(ex);
  }
}
Program: 97140
Project: 97140
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + authorId + "String_Node_Str"+ branchUuid+ "String_Node_Str"+ comment+ "String_Node_Str"+ commitId+ "String_Node_Str"+ date+ "String_Node_Str"+ type+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + getGuid() + "String_Node_Str"+ authorId+ "String_Node_Str"+ branchUuid+ "String_Node_Str"+ comment+ "String_Node_Str"+ commitId+ "String_Node_Str"+ date+ "String_Node_Str"+ type+ "String_Node_Str";
}
Program: 97141
Project: 97141
Buggy source:
@Override public Collection<ITransaction> getCommittedArtifactTransactionIds(IAtsTeamWorkflow teamWf){
  ArtifactReadable artifactReadable=(ArtifactReadable)teamWf;
  List<ITransaction> transactionIds=commitArtifactIdMap.get(artifactReadable.getLocalId());
  if (transactionIds == null) {
    transactionIds=new ArrayList<ITransaction>(5);
    TransactionQuery txQuery=orcsApi.getQueryFactory(null).transactionQuery();
    txQuery.andCommitIds(artifactReadable.getLocalId());
    for (    TransactionReadable tx : txQuery.getResults()) {
      transactionIds.add(tx);
    }
    commitArtifactIdMap.put(artifactReadable.getLocalId(),transactionIds);
  }
  return transactionIds;
}

Fixed version (ground truth):
@Override public Collection<ITransaction> getCommittedArtifactTransactionIds(IAtsTeamWorkflow teamWf){
  ArtifactReadable artifactReadable=(ArtifactReadable)teamWf.getStoreObject();
  List<ITransaction> transactionIds=commitArtifactIdMap.get(artifactReadable.getLocalId());
  if (transactionIds == null) {
    transactionIds=new ArrayList<ITransaction>(5);
    TransactionQuery txQuery=orcsApi.getQueryFactory(null).transactionQuery();
    txQuery.andCommitIds(artifactReadable.getLocalId());
    for (    TransactionReadable tx : txQuery.getResults()) {
      transactionIds.add(tx);
    }
    commitArtifactIdMap.put(artifactReadable.getLocalId(),transactionIds);
  }
  return transactionIds;
}
Program: 97142
Project: 97142
Buggy source:
public void reload(){
  if (isTableDisposed()) {
    return;
  }
  Job job=new Job(String.format("String_Node_Str",provider.getItemName())){
    @Override protected IStatus run(    IProgressMonitor monitor){
      if (isTableDisposed()) {
        return Status.OK_STATUS;
      }
      try {
        final List<Artifact> artifacts=provider.getMembers();
        try {
          AtsBulkLoad.bulkLoadArtifacts(artifacts);
        }
 catch (        OseeCoreException ex) {
          OseeLog.log(Activator.class,Level.SEVERE,ex);
        }
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            if (isTableDisposed()) {
              return;
            }
            worldComposite.load(provider.getItemName(),artifacts,(CustomizeData)null,TableLoadOption.None);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
        return new Status(IStatus.ERROR,Activator.PLUGIN_ID,String.format("String_Node_Str",provider.getItemName()),ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,false);
}

Fixed version (ground truth):
public void reload(){
  if (isTableDisposed()) {
    return;
  }
  Job job=new Job(String.format("String_Node_Str",provider.getItemName())){
    @Override protected IStatus run(    IProgressMonitor monitor){
      if (isTableDisposed()) {
        return Status.OK_STATUS;
      }
      try {
        final List<Artifact> artifacts=provider.getMembers();
        worldComposite.load(provider.getItemName(),artifacts,(CustomizeData)null,TableLoadOption.None);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
        return new Status(IStatus.ERROR,Activator.PLUGIN_ID,String.format("String_Node_Str",provider.getItemName()),ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,false);
}
Program: 97144
Project: 97144
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);
    }
  }
  try {
    AtsBulkLoad.bulkLoadArtifacts(arts);
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
  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);
    }
  }
  setInput(arts);
}
Program: 97145
Project: 97145
Buggy source:
@Override public void run(){
  worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  try {
    final Set<Artifact> arts=new HashSet<Artifact>();
    for (    Artifact art : artifacts) {
      if (art.isOfType(AtsArtifactTypes.Action)) {
        for (        TeamWorkFlowArtifact team : ActionManager.getTeams(art)) {
          arts.addAll(ReviewManager.getReviews(team));
        }
      }
 else       if (art.isOfType(AtsArtifactTypes.TeamWorkflow)) {
        arts.addAll(ReviewManager.getReviews((TeamWorkFlowArtifact)art));
      }
    }
    worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
  return Status.OK_STATUS;
}
Program: 97146
Project: 97146
Buggy source:
public void redisplayAsReviews(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            for (            TeamWorkFlowArtifact team : ActionManager.getTeams(art)) {
              arts.addAll(ReviewManager.getReviews(team));
            }
          }
 else           if (art.isOfType(AtsArtifactTypes.TeamWorkflow)) {
            arts.addAll(ReviewManager.getReviews((TeamWorkFlowArtifact)art));
          }
        }
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}

Fixed version (ground truth):
public void redisplayAsReviews(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            for (            TeamWorkFlowArtifact team : ActionManager.getTeams(art)) {
              arts.addAll(ReviewManager.getReviews(team));
            }
          }
 else           if (art.isOfType(AtsArtifactTypes.TeamWorkflow)) {
            arts.addAll(ReviewManager.getReviews((TeamWorkFlowArtifact)art));
          }
        }
        worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}
Program: 97147
Project: 97147
Buggy source:
public void redisplayAsGoals(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> goals=new HashSet<Artifact>();
        new GoalManager().getCollectors(artifacts,goals,true);
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),goals);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}

Fixed version (ground truth):
public void redisplayAsGoals(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> goals=new HashSet<Artifact>();
        new GoalManager().getCollectors(artifacts,goals,true);
        worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),goals);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}
Program: 97148
Project: 97148
Buggy source:
public void redisplayAsAction(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            arts.add(art);
          }
 else           if (art instanceof AbstractWorkflowArtifact) {
            Artifact parentArt=((AbstractWorkflowArtifact)art).getParentActionArtifact();
            if (parentArt != null) {
              arts.add(parentArt);
            }
          }
        }
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}

Fixed version (ground truth):
public void redisplayAsAction(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            arts.add(art);
          }
 else           if (art instanceof AbstractWorkflowArtifact) {
            Artifact parentArt=((AbstractWorkflowArtifact)art).getParentActionArtifact();
            if (parentArt != null) {
              arts.add(parentArt);
            }
          }
        }
        worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}
Program: 97149
Project: 97149
Buggy source:
public void redisplayAsWorkFlow(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            arts.addAll(ActionManager.getTeams(art));
          }
 else           if (art instanceof AbstractWorkflowArtifact) {
            Artifact parentArt=((AbstractWorkflowArtifact)art).getParentTeamWorkflow();
            if (parentArt != null) {
              arts.add(parentArt);
            }
          }
        }
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}

Fixed version (ground truth):
public void redisplayAsWorkFlow(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            arts.addAll(ActionManager.getTeams(art));
          }
 else           if (art instanceof AbstractWorkflowArtifact) {
            Artifact parentArt=((AbstractWorkflowArtifact)art).getParentTeamWorkflow();
            if (parentArt != null) {
              arts.add(parentArt);
            }
          }
        }
        worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}
Program: 97150
Project: 97150
Buggy source:
public void redisplayAsTask(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            for (            TeamWorkFlowArtifact team : ActionManager.getTeams(art)) {
              arts.addAll(team.getTaskArtifacts());
            }
          }
 else           if (art instanceof AbstractTaskableArtifact) {
            arts.addAll(((AbstractTaskableArtifact)art).getTaskArtifacts());
          }
        }
        Displays.ensureInDisplayThread(new Runnable(){
          @Override public void run(){
            worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
          }
        }
);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}

Fixed version (ground truth):
public void redisplayAsTask(){
  final List<Artifact> artifacts=worldComposite.getXViewer().getLoadedArtifacts();
  Job job=new Job("String_Node_Str"){
    @Override protected IStatus run(    IProgressMonitor monitor){
      try {
        final Set<Artifact> arts=new HashSet<Artifact>();
        for (        Artifact art : artifacts) {
          if (art.isOfType(AtsArtifactTypes.Action)) {
            for (            TeamWorkFlowArtifact team : ActionManager.getTeams(art)) {
              arts.addAll(team.getTaskArtifacts());
            }
          }
 else           if (art instanceof AbstractTaskableArtifact) {
            arts.addAll(((AbstractTaskableArtifact)art).getTaskArtifacts());
          }
        }
        worldComposite.load(worldEditor.getWorldXWidgetActionPage().getCurrentTitleLabel(),arts);
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
      return Status.OK_STATUS;
    }
  }
;
  Jobs.startJob(job,true);
}
Program: 97151
Project: 97151
Buggy source:
@Override public void run(){
  try {
    iRefreshActionHandler.refreshActionHandler();
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  try {
    iRefreshActionHandler.refreshActionHandler();
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
  return Status.OK_STATUS;
}
Program: 97152
Project: 97152
Buggy source:
/** 
 * Get file extension from the file path
 * @return file extension
 */
public static String getExtension(String filepath){
  filepath=filepath.trim();
  String separatorRegEx=File.separator;
  if (Lib.isWindows()) {
    separatorRegEx="String_Node_Str";
  }
  String[] pathsArray=filepath.split(separatorRegEx);
  String fileName=pathsArray[0];
  if (pathsArray.length > 0) {
    fileName=pathsArray[pathsArray.length - 1];
  }
  int index=fileName.lastIndexOf('.');
  if (index >= 0 && index + 1 < fileName.length()) {
    return fileName.substring(index + 1);
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Get file extension from the file path
 * @return file extension
 */
public static String getExtension(String filepath){
  String toReturn="String_Node_Str";
  if (Strings.isValid(filepath)) {
    String toProcess=filepath.trim();
    toProcess=toProcess.replaceAll("String_Node_Str","String_Node_Str");
    String[] pathsArray=toProcess.split("String_Node_Str");
    String fileName=pathsArray[0];
    if (pathsArray.length > 0) {
      fileName=pathsArray[pathsArray.length - 1];
    }
    int index=fileName.lastIndexOf('.');
    if (index >= 0 && index + 1 < fileName.length()) {
      toReturn=fileName.substring(index + 1);
    }
  }
  return toReturn;
}
Program: 97153
Project: 97153
Buggy source:
@Override protected Control createDialogArea(Composite container){
  Control comp=super.createDialogArea(container);
  try {
    getTreeViewer().getViewer().setInput(selectable);
  }
 catch (  Exception ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
  return comp;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite container){
  return super.createDialogArea(container);
}
Program: 97154
Project: 97154
Buggy source:
public FilteredCheckboxTreeDialog(String title,Set<Artifact> artifacts){
  this(title,title,new ArtifactContentProvider(),new ArtifactLabelProvider(),new ArtifactViewerSorter());
}

Fixed version (ground truth):
public FilteredCheckboxTreeDialog(String dialogTitle,String dialogMessage,Set<Artifact> artifacts,IContentProvider contentProvider,IBaseLabelProvider labelProvider,ViewerSorter viewerSorter){
  this(dialogTitle,dialogMessage,contentProvider,labelProvider,viewerSorter);
  this.selectables=artifacts;
}
Program: 97155
Project: 97155
Buggy source:
protected FilterableCheckboxTreeViewer getCheckboxTreeViewer(){
  return (FilterableCheckboxTreeViewer)treeViewer.getViewer();
}

Fixed version (ground truth):
protected FilterableCheckboxTreeViewer getCheckboxTreeViewer(){
  return treeViewer.getCheckboxTreeViewer();
}
Program: 97157
Project: 97157
Buggy source:
private boolean hasExtension(String path){
  String extension=Lib.getExtension(path);
  return Strings.isValid(extension);
}

Fixed version (ground truth):
private boolean hasExtension(String path){
  String extension=null;
  if (Strings.isValid(path)) {
    int index=path.lastIndexOf("String_Node_Str");
    String toProcess=path;
    if (index > 0 && index + 1 < path.length()) {
      toProcess=path.substring(index + 1);
    }
    extension=Lib.getExtension(toProcess);
  }
  return Strings.isValid(extension);
}
Program: 97158
Project: 97158
Buggy source:
private String addExtension(String path,MediaType mediaType){
  String extension=mediaType.getSubtype();
  if (extension.contains("String_Node_Str")) {
    int index=extension.lastIndexOf("String_Node_Str");
    if (index > 0 && index + 1 < extension.length()) {
      extension=extension.substring(index + 1);
    }
  }
 else   if (extension.contains("String_Node_Str")) {
    extension=Lib.getExtension(extension);
  }
  String toReturn=null;
  if (Strings.isValid(extension)) {
    StringBuilder builder=new StringBuilder(path);
    builder.append("String_Node_Str");
    builder.append(extension);
    toReturn=builder.toString();
  }
  return toReturn;
}

Fixed version (ground truth):
private String addExtension(String path,MediaType mediaType){
  String extension=mediaType.getSubtype();
  if ("String_Node_Str".equals(extension)) {
    extension="String_Node_Str";
  }
 else   if (extension.contains("String_Node_Str")) {
    int index=extension.lastIndexOf("String_Node_Str");
    if (index > 0 && index + 1 < extension.length()) {
      extension=extension.substring(index + 1);
    }
  }
 else   if (extension.contains("String_Node_Str")) {
    extension=Lib.getExtension(extension);
  }
  String toReturn=null;
  if (Strings.isValid(extension)) {
    StringBuilder builder=new StringBuilder(path);
    builder.append("String_Node_Str");
    builder.append(extension);
    toReturn=builder.toString();
  }
  return toReturn;
}
Program: 97159
Project: 97159
Buggy source:
public static void computeXTextSize(XText xText){
  int height=xText.getStyledText().getLineCount() * xText.getStyledText().getLineHeight();
  GridData formTextGd=new GridData(SWT.FILL,SWT.FILL,true,true);
  if (xText.isFillVertically() && height < 60) {
    formTextGd.heightHint=60;
  }
 else {
    formTextGd.heightHint=height;
  }
  formTextGd.widthHint=200;
  xText.getStyledText().setLayoutData(formTextGd);
}

Fixed version (ground truth):
public static void computeXTextSize(XText xText){
  if (Widgets.isAccessible(xText.getStyledText())) {
    int height=xText.getStyledText().getLineCount() * xText.getStyledText().getLineHeight();
    GridData formTextGd=new GridData(SWT.FILL,SWT.FILL,true,true);
    if (xText.isFillVertically() && height < 60) {
      formTextGd.heightHint=60;
    }
 else {
      formTextGd.heightHint=height;
    }
    formTextGd.widthHint=200;
    xText.getStyledText().setLayoutData(formTextGd);
  }
}