nus-yam/ex-repair huggingface dataset:
Program: 137485
Project: 137485
Buggy source:
private void updateWithExtendedColumn(String[] inputRow,String[] masterRecord,double matchingProba,String distanceDetails,String delimiter,String escCharacter) throws IOException, InterruptedException {
  String[] duplicateRecord=new String[masterRecord.length];
  for (int idx=0; idx < inputRow.length; idx++) {
    duplicateRecord[idx]=inputRow[idx];
  }
  duplicateRecord[duplicateRecord.length - extSize]=masterRecord[masterRecord.length - extSize];
  duplicateRecord[duplicateRecord.length - extSize + 1]=String.valueOf(0);
  duplicateRecord[duplicateRecord.length - extSize + 2]=String.valueOf(false);
  duplicateRecord[duplicateRecord.length - extSize + 3]=String.valueOf(matchingProba);
  int extIdx=3;
  if (isSeperateOutput) {
    extIdx++;
    double groupQuality=computeGroupQuality(masterRecord,matchingProba,extIdx);
    masterRecord[duplicateRecord.length - extSize + extIdx]=String.valueOf(groupQuality);
  }
  if (isOutputDistDetails) {
    extIdx++;
    duplicateRecord[duplicateRecord.length - extSize + extIdx]=distanceDetails;
  }
  outputRow(StringUtilities.join(duplicateRecord,delimiter,escCharacter));
}

Fixed version (ground truth):
private void updateWithExtendedColumn(String[] inputRow,String[] masterRecord,double matchingProba,String distanceDetails,String delimiter) throws IOException, InterruptedException {
  String[] duplicateRecord=new String[masterRecord.length];
  for (int idx=0; idx < inputRow.length; idx++) {
    duplicateRecord[idx]=inputRow[idx];
  }
  duplicateRecord[duplicateRecord.length - extSize]=masterRecord[masterRecord.length - extSize];
  duplicateRecord[duplicateRecord.length - extSize + 1]=String.valueOf(0);
  duplicateRecord[duplicateRecord.length - extSize + 2]=String.valueOf(false);
  duplicateRecord[duplicateRecord.length - extSize + 3]=String.valueOf(matchingProba);
  int extIdx=3;
  if (isSeperateOutput) {
    extIdx++;
    double groupQuality=computeGroupQuality(masterRecord,matchingProba,extIdx);
    masterRecord[duplicateRecord.length - extSize + extIdx]=String.valueOf(groupQuality);
  }
  if (isOutputDistDetails) {
    extIdx++;
    duplicateRecord[duplicateRecord.length - extSize + extIdx]=distanceDetails;
  }
  outputRow(StringUtilities.join(duplicateRecord,delimiter,StringUtilities.ESCAPE_CHARACTER));
}
Program: 137486
Project: 137486
Buggy source:
public AnalysisMatchRecordGrouping(MatchGroupResultConsumer matchResultConsumer){
  this.matchResultConsumer=matchResultConsumer;
  setColumnDelimiter(columnDelimiter);
  setEscapeCharacter(escapeCharacter);
  setIsOutputDistDetails(true);
  setSeperateOutput(Boolean.TRUE);
}

Fixed version (ground truth):
public AnalysisMatchRecordGrouping(MatchGroupResultConsumer matchResultConsumer){
  this.matchResultConsumer=matchResultConsumer;
  setColumnDelimiter(columnDelimiter);
  setIsOutputDistDetails(true);
  setSeperateOutput(Boolean.TRUE);
}
Program: 137487
Project: 137487
Buggy source:
@Override protected void outputRow(String row){
  matchResultConsumer.handle(StringUtilities.split(row,columnDelimiter,escapeCharacter));
}

Fixed version (ground truth):
@Override protected void outputRow(String row){
  matchResultConsumer.handle(StringUtilities.split(row,columnDelimiter,StringUtilities.ESCAPE_CHARACTER));
}
Program: 137491
Project: 137491
Buggy source:
/** 
 * Test method for   {@link org.talend.dataprofiler.core.ui.action.actions.DQEmptyRecycleBinAction#run()}. there is a dependce for a node in recycle bin,and this depence is not in recycle bin.
 * @throws Exception
 */
@Test public void testRun_2() throws Exception {
  PowerMockito.doNothing().when(dqEmptyAction_mock,"String_Node_Str");
  IRepositoryNode node1=mock(IRepositoryNode.class);
  List<IRepositoryNode> seleLs=new ArrayList<IRepositoryNode>();
  ISelection selecetion=new StructuredSelection(seleLs);
  PowerMockito.doReturn(selecetion).when(dqEmptyAction_mock).getSelection();
  seleLs.add(node1);
  PowerMockito.mockStatic(DQDeleteHelper.class);
  List<IRepositoryNode> ls=new ArrayList<IRepositoryNode>();
  when(DQDeleteHelper.getCanNotDeletedNodes(seleLs,false)).thenReturn(ls);
  RecycleBinRepNode recyBin=mock(RecycleBinRepNode.class);
  PowerMockito.mockStatic(RepositoryNodeHelper.class);
  when(RepositoryNodeHelper.getRecycleBinRepNode()).thenReturn(recyBin);
  when(RepositoryNodeHelper.findAllChildrenNodes(seleLs)).thenReturn(seleLs);
  when(recyBin.getChildren()).thenReturn(seleLs);
  dqEmptyAction_mock.run();
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dataprofiler.core.ui.action.actions.DQEmptyRecycleBinAction#run()}. there is a dependce for a node in recycle bin,and this depence is not in recycle bin.
 * @throws Exception
 */
@Test public void testRun_2() throws Exception {
  PowerMockito.doNothing().when(dqEmptyAction_mock,"String_Node_Str");
  IRepositoryNode node1=mock(IRepositoryNode.class);
  Set<IRepositoryNode> seleLs=new HashSet<IRepositoryNode>();
  ISelection selecetion=new StructuredSelection(seleLs);
  PowerMockito.doReturn(selecetion).when(dqEmptyAction_mock).getSelection();
  seleLs.add(node1);
  PowerMockito.mockStatic(DQDeleteHelper.class);
  List<IRepositoryNode> ls=new ArrayList<IRepositoryNode>();
  when(DQDeleteHelper.getCanNotDeletedNodes(seleLs,false)).thenReturn(ls);
  RecycleBinRepNode recyBin=mock(RecycleBinRepNode.class);
  PowerMockito.mockStatic(RepositoryNodeHelper.class);
  when(RepositoryNodeHelper.getRecycleBinRepNode()).thenReturn(recyBin);
  when(RepositoryNodeHelper.findAllChildrenNodes(seleLs)).thenReturn(seleLs);
  List<IRepositoryNode> repsList=new ArrayList<IRepositoryNode>();
  repsList.addAll(seleLs);
  when(recyBin.getChildren()).thenReturn(repsList);
  dqEmptyAction_mock.run();
}
Program: 137496
Project: 137496
Buggy source:
/** 
 * Find the matched columnSet of matchDataProvider.
 * @param selectedColumnSet
 * @return
 * @throws ReloadCompareException
 */
public static ColumnSet findMatchedColumnSet(ColumnSet selectedColumnSet,Connection toMatchDataProvider) throws ReloadCompareException {
  Package parentCatalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(selectedColumnSet);
  Package toReloadPackage=DQStructureComparer.findMatchedPackage(parentCatalogOrSchema,toMatchDataProvider);
  TdTable oldTable=SwitchHelpers.TABLE_SWITCH.doSwitch(selectedColumnSet);
  ColumnSet toReloadcolumnSet=null;
  if (oldTable != null) {
    List<TdTable> tables=PackageHelper.getTables(toReloadPackage);
    for (    TdTable table : tables) {
      if (oldTable.getName().equals(table.getName()) && (ColumnSetHelper.getTableOwner(oldTable) == null || ColumnSetHelper.getTableOwner(oldTable).equals(ColumnSetHelper.getTableOwner(table)))) {
        toReloadcolumnSet=table;
        break;
      }
    }
  }
 else {
    List<TdView> views=PackageHelper.getViews(toReloadPackage);
    for (    TdView view : views) {
      if (selectedColumnSet.getName().equals(view.getName()) && (ColumnSetHelper.getTableOwner(selectedColumnSet) == null || ColumnSetHelper.getTableOwner(selectedColumnSet).equals(ColumnSetHelper.getTableOwner(view)))) {
        toReloadcolumnSet=view;
        break;
      }
    }
  }
  if (toReloadcolumnSet == null) {
    throw new ReloadCompareException(DefaultMessagesImpl.getString("String_Node_Str",selectedColumnSet.getName()));
  }
  return toReloadcolumnSet;
}

Fixed version (ground truth):
/** 
 * Find the matched columnSet of matchDataProvider.
 * @param selectedColumnSet
 * @return
 * @throws ReloadCompareException
 */
public static ColumnSet findMatchedColumnSet(ColumnSet selectedColumnSet,Connection toMatchDataProvider) throws ReloadCompareException {
  Package parentCatalogOrSchema=ColumnSetHelper.getParentCatalogOrSchema(selectedColumnSet);
  Package toReloadPackage=DQStructureComparer.findMatchedPackage(parentCatalogOrSchema,toMatchDataProvider);
  TdTable oldTable=SwitchHelpers.TABLE_SWITCH.doSwitch(selectedColumnSet);
  ColumnSet toReloadcolumnSet=null;
  if (oldTable != null) {
    List<TdTable> tables=PackageHelper.getTables(toReloadPackage);
    for (    TdTable table : tables) {
      if (oldTable.getName().equals(table.getName())) {
        toReloadcolumnSet=table;
        break;
      }
    }
  }
 else {
    List<TdView> views=PackageHelper.getViews(toReloadPackage);
    for (    TdView view : views) {
      if (selectedColumnSet.getName().equals(view.getName())) {
        toReloadcolumnSet=view;
        break;
      }
    }
  }
  if (toReloadcolumnSet == null) {
    throw new ReloadCompareException(DefaultMessagesImpl.getString("String_Node_Str",selectedColumnSet.getName()));
  }
  return toReloadcolumnSet;
}
Program: 137497
Project: 137497
Buggy source:
/** 
 * try the sybase db type. Test method for  {@link org.talend.dq.helper.AnalysisExecutorHelper#getTableName(orgomg.cwm.objectmodel.core.ModelElement,org.talend.dq.dbms.DbmsLanguage)}.
 */
@Test public void testGetTableName_3(){
  TdColumn tdColumn=RelationalFactory.eINSTANCE.createTdColumn();
  TdTable tdTable=RelationalFactory.eINSTANCE.createTdTable();
  tdTable.setName("String_Node_Str");
  tdColumn.setOwner(tdTable);
  tdColumn.setName("String_Node_Str");
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage(),null);
  Package schema=orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createSchema();
  schema.setName("String_Node_Str");
  tdTable.setNamespace(schema);
  Package catalog=orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createCatalog();
  catalog.setName("String_Node_Str");
  schema.setNamespace(catalog);
  TaggedValue taggedValue=TaggedValueHelper.createTaggedValue(TaggedValueHelper.TABLE_OWNER,"String_Node_Str");
  tdTable.getTaggedValue().add(taggedValue);
  assertEquals("String_Node_Str",AnalysisExecutorHelper.getTableName(tdColumn,dbmsLanguage));
}

Fixed version (ground truth):
/** 
 * try the sybase db type. Test method for  {@link org.talend.dq.helper.AnalysisExecutorHelper#getTableName(orgomg.cwm.objectmodel.core.ModelElement,org.talend.dq.dbms.DbmsLanguage)}.
 */
@Test public void testGetTableName_3(){
  TdColumn tdColumn=RelationalFactory.eINSTANCE.createTdColumn();
  TdTable tdTable=RelationalFactory.eINSTANCE.createTdTable();
  tdTable.setName("String_Node_Str");
  tdColumn.setOwner(tdTable);
  tdColumn.setName("String_Node_Str");
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(SupportDBUrlType.SYBASEDEFAULTURL.getLanguage(),null);
  Package schema=orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createSchema();
  schema.setName("String_Node_Str");
  tdTable.setNamespace(schema);
  Package catalog=orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createCatalog();
  catalog.setName("String_Node_Str");
  schema.setNamespace(catalog);
  assertEquals("String_Node_Str",AnalysisExecutorHelper.getTableName(tdColumn,dbmsLanguage));
}
Program: 137499
Project: 137499
Buggy source:
@Override public void end() throws IOException, InterruptedException {
  for (  String[] mst : masterRecords) {
    outputRow(StringUtils.join(mst,columnDelimiter));
  }
}

Fixed version (ground truth):
@Override public void end() throws IOException, InterruptedException {
  for (  String[] mst : masterRecords) {
    outputRow(StringUtilities.join(mst,columnDelimiter,escapeCharacter));
  }
}
Program: 137500
Project: 137500
Buggy source:
private void updateWithExtendedColumn(String[] inputRow,String[] masterRecord,double matchingProba,String distanceDetails,String delimiter) throws IOException, InterruptedException {
  String[] duplicateRecord=new String[masterRecord.length];
  for (int idx=0; idx < inputRow.length; idx++) {
    duplicateRecord[idx]=inputRow[idx];
  }
  duplicateRecord[duplicateRecord.length - extSize]=masterRecord[masterRecord.length - extSize];
  duplicateRecord[duplicateRecord.length - extSize + 1]=String.valueOf(0);
  duplicateRecord[duplicateRecord.length - extSize + 2]=String.valueOf(false);
  duplicateRecord[duplicateRecord.length - extSize + 3]=String.valueOf(matchingProba);
  int extIdx=3;
  if (isSeperateOutput) {
    extIdx++;
    double groupQuality=computeGroupQuality(masterRecord,matchingProba,extIdx);
    masterRecord[duplicateRecord.length - extSize + extIdx]=String.valueOf(groupQuality);
  }
  if (isOutputDistDetails) {
    extIdx++;
    duplicateRecord[duplicateRecord.length - extSize + extIdx]=distanceDetails;
  }
  outputRow(StringUtils.join(duplicateRecord,delimiter));
}

Fixed version (ground truth):
private void updateWithExtendedColumn(String[] inputRow,String[] masterRecord,double matchingProba,String distanceDetails,String delimiter,String escCharacter) throws IOException, InterruptedException {
  String[] duplicateRecord=new String[masterRecord.length];
  for (int idx=0; idx < inputRow.length; idx++) {
    duplicateRecord[idx]=inputRow[idx];
  }
  duplicateRecord[duplicateRecord.length - extSize]=masterRecord[masterRecord.length - extSize];
  duplicateRecord[duplicateRecord.length - extSize + 1]=String.valueOf(0);
  duplicateRecord[duplicateRecord.length - extSize + 2]=String.valueOf(false);
  duplicateRecord[duplicateRecord.length - extSize + 3]=String.valueOf(matchingProba);
  int extIdx=3;
  if (isSeperateOutput) {
    extIdx++;
    double groupQuality=computeGroupQuality(masterRecord,matchingProba,extIdx);
    masterRecord[duplicateRecord.length - extSize + extIdx]=String.valueOf(groupQuality);
  }
  if (isOutputDistDetails) {
    extIdx++;
    duplicateRecord[duplicateRecord.length - extSize + extIdx]=distanceDetails;
  }
  outputRow(StringUtilities.join(duplicateRecord,delimiter,escCharacter));
}
Program: 137501
Project: 137501
Buggy source:
public AnalysisMatchRecordGrouping(MatchGroupResultConsumer matchResultConsumer){
  this.matchResultConsumer=matchResultConsumer;
  setColumnDelimiter(columnDelimiter);
  setIsOutputDistDetails(true);
  setSeperateOutput(Boolean.TRUE);
}

Fixed version (ground truth):
public AnalysisMatchRecordGrouping(MatchGroupResultConsumer matchResultConsumer){
  this.matchResultConsumer=matchResultConsumer;
  setColumnDelimiter(columnDelimiter);
  setEscapeCharacter(escapeCharacter);
  setIsOutputDistDetails(true);
  setSeperateOutput(Boolean.TRUE);
}
Program: 137502
Project: 137502
Buggy source:
@Override protected void outputRow(String row){
  matchResultConsumer.handle(StringUtils.splitByWholeSeparatorPreserveAllTokens(row,columnDelimiter));
}

Fixed version (ground truth):
@Override protected void outputRow(String row){
  matchResultConsumer.handle(StringUtilities.split(row,columnDelimiter,escapeCharacter));
}
Program: 137503
Project: 137503
Buggy source:
/** 
 * if these items in recycle bin are depended by others which is not in recycle bin,show a warning and return.
 * @param allNodes
 * @param isCurrentPerspectiveDQ
 * @return these list will be used to pop a dialog and display the detail nodes which are depended by others.
 */
public static List<IRepositoryNode> getCanNotDeletedNodes(List<IRepositoryNode> allNodes,boolean isCurrentPerspectiveDQ){
  List<IRepositoryNode> canNotDeletedNodes=new ArrayList<IRepositoryNode>();
  if (allNodes == null) {
    return canNotDeletedNodes;
  }
  for (  IRepositoryNode node : allNodes) {
    List<ModelElement> dependencies=EObjectHelper.getDependencyClients(node);
    if (node.getObject() != null && ERepositoryObjectType.TDQ_JRAXML_ELEMENT.equals(node.getObject().getRepositoryObjectType())) {
      dependencies=getDependedReportOfJrxml(node);
    }
    if (dependencies == null || dependencies.isEmpty()) {
      continue;
    }
    if (!isCurrentPerspectiveDQ) {
      canNotDeletedNodes.add(node);
      continue;
    }
    for (    ModelElement mod : dependencies) {
      Property property=PropertyHelper.getProperty(mod);
      if (property == null) {
        continue;
      }
      Item item=property.getItem();
      if (item != null && !item.getState().isDeleted()) {
        canNotDeletedNodes.add(node);
      }
    }
  }
  return canNotDeletedNodes;
}

Fixed version (ground truth):
/** 
 * if these items in recycle bin are depended by others which is not in recycle bin,show a warning and return.
 * @param allNodes
 * @param isCurrentPerspectiveDQ
 * @return these list will be used to pop a dialog and display the detail nodes which are depended by others.
 */
public static List<IRepositoryNode> getCanNotDeletedNodes(Collection<IRepositoryNode> allNodes,boolean isCurrentPerspectiveDQ){
  List<IRepositoryNode> canNotDeletedNodes=new ArrayList<IRepositoryNode>();
  if (allNodes == null) {
    return canNotDeletedNodes;
  }
  for (  IRepositoryNode node : allNodes) {
    List<ModelElement> dependencies=EObjectHelper.getDependencyClients(node);
    if (node.getObject() != null && ERepositoryObjectType.TDQ_JRAXML_ELEMENT.equals(node.getObject().getRepositoryObjectType())) {
      dependencies=getDependedReportOfJrxml(node);
    }
    if (dependencies == null || dependencies.isEmpty()) {
      continue;
    }
    if (!isCurrentPerspectiveDQ) {
      canNotDeletedNodes.add(node);
      continue;
    }
    for (    ModelElement mod : dependencies) {
      Property property=PropertyHelper.getProperty(mod);
      if (property == null) {
        continue;
      }
      Item item=property.getItem();
      if (item != null && !item.getState().isDeleted()) {
        canNotDeletedNodes.add(node);
      }
    }
  }
  return canNotDeletedNodes;
}
Program: 137504
Project: 137504
Buggy source:
/** 
 * DOC gdbu Comment method "fillTreeList". Filter's entry method.
 * @param monitor
 */
public static void fillTreeList(IProgressMonitor monitor){
  allFilteredNodeList.clear();
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(false);
  List<IRepositoryNode> list=new ArrayList<IRepositoryNode>();
  list.add(getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING,true));
  list.add(getRootNode(ERepositoryObjectType.TDQ_LIBRARIES,true));
  list.add(getRootNode(ERepositoryObjectType.METADATA,true));
  list.add(getRootNode(ERepositoryObjectType.RECYCLE_BIN,true));
  for (  IRepositoryNode iRepositoryNode : list) {
    allFilteredNodeList.addAll(getTreeList(iRepositoryNode));
    if (null != monitor) {
      monitor.worked(2);
    }
  }
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(true);
}

Fixed version (ground truth):
/** 
 * DOC gdbu Comment method "fillTreeList". Filter's entry method.
 * @param monitor
 */
public static void fillTreeList(IProgressMonitor monitor){
  allFilteredNodeList.clear();
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(false);
  List<IRepositoryNode> list=new ArrayList<IRepositoryNode>();
  list.add(getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING,true));
  list.add(getRootNode(ERepositoryObjectType.TDQ_LIBRARIES,true));
  list.add(getRootNode(ERepositoryObjectType.METADATA,true));
  list.add(getRecycleBinRepNode());
  for (  IRepositoryNode iRepositoryNode : list) {
    allFilteredNodeList.addAll(getTreeList(iRepositoryNode));
    if (null != monitor) {
      monitor.worked(2);
    }
  }
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(true);
}
Program: 137505
Project: 137505
Buggy source:
/** 
 * ADD gdbu 2011-11-15 TDQ-3969 DOC gdbu Comment method "getRecycleBinFilteredNodes". This method could return a list contains recycle bin node and all of it's children.
 * @return
 */
private static List<IRepositoryNode> getRecycleBinFilteredNodes(){
  return getTreeList(getRootNode(ERepositoryObjectType.RECYCLE_BIN,true));
}

Fixed version (ground truth):
/** 
 * ADD gdbu 2011-11-15 TDQ-3969 DOC gdbu Comment method "getRecycleBinFilteredNodes". This method could return a list contains recycle bin node and all of it's children.
 * @return
 */
private static List<IRepositoryNode> getRecycleBinFilteredNodes(){
  return getTreeList(getRecycleBinRepNode());
}
Program: 137506
Project: 137506
Buggy source:
/** 
 * get recycle bin node.
 * @return
 */
public static RepositoryNode getRecycleBinRootNode(){
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(false);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        break;
      }
    }
  }
  return node;
}

Fixed version (ground truth):
/** 
 * get recycle bin node.
 * @return
 * @deprecated use {@link #getRecycleBinRepNode()} instead
 */
@Deprecated public static RepositoryNode getRecycleBinRootNode(){
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(false);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        break;
      }
    }
  }
  return node;
}
Program: 137507
Project: 137507
Buggy source:
/** 
 * ADD gdbu 2011-11-24 TDQ-4068 To get all children nodes. DOC gdbu Comment method "findRecycleBinNodeWhenFiltering".
 * @param recycleBinNodes
 * @return
 */
public static List<IRepositoryNode> findAllChildrenNodes(List<IRepositoryNode> recycleBinNodes){
  List<IRepositoryNode> findAllRecycleBinNode=new ArrayList<IRepositoryNode>();
  findAllRecycleBinNode.addAll(recycleBinNodes);
  for (  IRepositoryNode iRepositoryNode : recycleBinNodes) {
    findAllRecycleBinNode.addAll(findAllChildrenNodes(iRepositoryNode.getChildren()));
  }
  return findAllRecycleBinNode;
}

Fixed version (ground truth):
/** 
 * ADD gdbu 2011-11-24 TDQ-4068 To get all children nodes. DOC gdbu Comment method "findRecycleBinNodeWhenFiltering".
 * @param recycleBinNodes
 * @return
 */
public static Collection<IRepositoryNode> findAllChildrenNodes(Collection<IRepositoryNode> recycleBinNodes){
  Set<IRepositoryNode> allChindrenNode=new HashSet<IRepositoryNode>();
  allChindrenNode.addAll(recycleBinNodes);
  for (  IRepositoryNode iRepositoryNode : recycleBinNodes) {
    allChindrenNode.addAll(findAllChildrenNodes(iRepositoryNode.getChildren()));
  }
  return allChindrenNode;
}
Program: 137508
Project: 137508
Buggy source:
/** 
 * get the RepositoryNode according to the nodeName.
 * @param nodeName the node name
 * @param open if the DQView is not show, show it or not
 * @return
 */
public static RepositoryNode getRootNode(ERepositoryObjectType nodeName,boolean open){
  FolderItem folderItem=ProxyRepositoryFactory.getInstance().getFolderItem(ProjectManager.getInstance().getCurrentProject(),nodeName,Path.EMPTY);
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(open);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        continue;
      }
      if (folderItem != null) {
        boolean isSysFolder=ENodeType.SYSTEM_FOLDER == node.getType() && FolderType.SYSTEM_FOLDER_LITERAL == folderItem.getType();
        if (isSysFolder) {
          String viewFolderLabel=folderItem.getProperty().getLabel();
          String folderLabel=node.getObject().getProperty().getLabel();
          if (viewFolderLabel.equals(folderLabel)) {
            return node;
          }
        }
      }
    }
  }
  log.error(Messages.getString("String_Node_Str") + nodeName.getLabel());
  return node;
}

Fixed version (ground truth):
/** 
 * get the RepositoryNode according to the ERepositoryObjectType(the ERepositoryObjectType should not be RECYCLE_BIN, because there doesn't exist a physical folder, so there will return null and log an error message; use getRecycleBinRepNode() to get the RecycleBinNode).
 * @param nodeType the node's ERepositoryObjectType
 * @param open if the DQView is not show, show it or not
 * @return
 */
public static RepositoryNode getRootNode(ERepositoryObjectType nodeType,boolean open){
  FolderItem folderItem=ProxyRepositoryFactory.getInstance().getFolderItem(ProjectManager.getInstance().getCurrentProject(),nodeType,Path.EMPTY);
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(open);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        continue;
      }
      if (folderItem != null) {
        boolean isSysFolder=ENodeType.SYSTEM_FOLDER == node.getType() && FolderType.SYSTEM_FOLDER_LITERAL == folderItem.getType();
        if (isSysFolder) {
          String viewFolderLabel=folderItem.getProperty().getLabel();
          String folderLabel=node.getObject().getProperty().getLabel();
          if (viewFolderLabel.equals(folderLabel)) {
            return node;
          }
        }
      }
    }
  }
  log.error(Messages.getString("String_Node_Str") + nodeType.getLabel());
  return node;
}
Program: 137509
Project: 137509
Buggy source:
/** 
 * find a node from recycle bin.
 * @param modelElement
 * @return
 */
public static RepositoryNode recursiveFindRecycleBin(ModelElement modelElement){
  if (modelElement == null) {
    return null;
  }
  String uuid=getUUID(modelElement);
  RepositoryNode recyBinNode=getRecycleBinRootNode();
  if (uuid == null || recyBinNode == null) {
    return null;
  }
  List<IRepositoryNode> children=recyBinNode.getChildren();
  return recursiveFindByUuid(uuid,children);
}

Fixed version (ground truth):
/** 
 * find a node from recycle bin.
 * @param modelElement
 * @return
 */
public static RepositoryNode recursiveFindRecycleBin(ModelElement modelElement){
  if (modelElement == null) {
    return null;
  }
  String uuid=getUUID(modelElement);
  RepositoryNode recyBinNode=getRecycleBinRepNode();
  if (uuid == null || recyBinNode == null) {
    return null;
  }
  List<IRepositoryNode> children=recyBinNode.getChildren();
  return recursiveFindByUuid(uuid,children);
}
Program: 137511
Project: 137511
Buggy source:
/** 
 * set the execution number of the analysis, if the running result is ok
 * @param analysis - which need to update the execution number
 * @param isRunAnaResultok - the running result of the analysis is ok or not
 */
public static void setExecutionNumberInAnalysisResult(Analysis analysis,boolean isRunAnaResultok){
  final ExecutionInformations resultMetadata=analysis.getResults().getResultMetadata();
  resultMetadata.setLastRunOk(isRunAnaResultok);
  int executionNumber=resultMetadata.getExecutionNumber() + 1;
  resultMetadata.setExecutionNumber(executionNumber);
  if (isRunAnaResultok) {
    resultMetadata.setLastExecutionNumberOk(executionNumber);
  }
}

Fixed version (ground truth):
/** 
 * set the execution number of the analysis, if the running result is ok
 * @param analysis - which need to update the execution number
 * @param isRunAnaResultok - the running result of the analysis is ok or not
 */
public static void setExecutionNumberInAnalysisResult(Analysis analysis,boolean isRunAnaResultok){
  final ExecutionInformations resultMetadata=analysis.getResults().getResultMetadata();
  resultMetadata.setLastRunOk(isRunAnaResultok);
  resultMetadata.setExecutionNumber(resultMetadata.getExecutionNumber() + 1);
  if (isRunAnaResultok) {
    resultMetadata.setLastExecutionNumberOk(resultMetadata.getLastExecutionNumberOk() + 1);
  }
}
Program: 137514
Project: 137514
Buggy source:
/** 
 * DOC yyi 2011-07-07 22246:view rows for average length for Oracle
 * @return average length sql statement
 */
public String getAverageLengthRows(){
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * DOC yyi 2011-07-07 22246:view rows for average length for Oracle
 * @return average length sql statement
 */
@Override public String getAverageLengthRows(){
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}
Program: 137515
Project: 137515
Buggy source:
public String toQualifiedName(String catalog,String schema,String table){
  return super.toQualifiedName(null,null,table);
}

Fixed version (ground truth):
@Override public String toQualifiedName(String catalog,String schema,String table){
  return super.toQualifiedName(null,null,table);
}
Program: 137517
Project: 137517
Buggy source:
/** 
 * get full name as: db.catalog.table, if has catalog/schema
 * @param analyzedColumns
 * @param dbmsLanguage
 * @return
 */
public static String getTableName(ModelElement analyzedColumn,DbmsLanguage dbmsLanguage){
  ModelElement columnSetOwner=findColumnSetOwner(analyzedColumn);
  String tableName=columnSetOwner.getName();
  String schemaName=getQuotedSchemaName(columnSetOwner,dbmsLanguage);
  String catalogName=getQuotedCatalogName(columnSetOwner,dbmsLanguage);
  if (catalogName == null && schemaName != null) {
    final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
    final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
    catalogName=parentCatalog != null ? parentCatalog.getName() : null;
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
  }
  DatabaseConnection dbConn=ConnectionHelper.getTdDataProvider(SwitchHelpers.COLUMN_SWITCH.doSwitch(analyzedColumn));
  if (dbConn.isContextMode()) {
    return getTableNameFromContext(dbConn,catalogName,schemaName,tableName,dbmsLanguage);
  }
 else {
    return dbmsLanguage.toQualifiedName(catalogName,schemaName,tableName);
  }
}

Fixed version (ground truth):
/** 
 * get full name as: db.catalog.table, if has catalog/schema
 * @param analyzedColumns
 * @param dbmsLanguage
 * @return
 */
public static String getTableName(ModelElement analyzedColumn,DbmsLanguage dbmsLanguage){
  ModelElement columnSetOwner=findColumnSetOwner(analyzedColumn);
  String tableName=columnSetOwner.getName();
  String schemaName=getQuotedSchemaName(columnSetOwner,dbmsLanguage);
  String catalogName=getQuotedCatalogName(columnSetOwner,dbmsLanguage);
  if (catalogName == null && schemaName != null) {
    final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
    final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
    catalogName=parentCatalog != null ? parentCatalog.getName() : null;
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
  }
  DatabaseConnection dbConn=ConnectionHelper.getTdDataProvider(SwitchHelpers.COLUMN_SWITCH.doSwitch(analyzedColumn));
  if (dbConn != null && dbConn.isContextMode()) {
    return getTableNameFromContext(dbConn,catalogName,schemaName,tableName,dbmsLanguage);
  }
 else {
    return dbmsLanguage.toQualifiedName(catalogName,schemaName,tableName);
  }
}
Program: 137518
Project: 137518
Buggy source:
/** 
 * DOC zshen Comment method "deleteIndicatorItems".
 * @param meIndicator
 * @param inidicatorUnit remove all the indicatorUnit which in the ModelElementIndicator.
 */
protected void deleteIndicatorItems(ModelElementIndicator meIndicator){
  for (  IndicatorUnit indiUnit : meIndicator.getIndicatorUnits()) {
    meIndicator.removeIndicatorUnit(indiUnit);
    addRemovedElements(absMasterPage.getAnalysis(),indiUnit);
  }
}

Fixed version (ground truth):
/** 
 * remove all the indicatorUnit which in the ModelElementIndicator.
 * @param meIndicator
 */
protected void deleteIndicatorItems(ModelElementIndicator meIndicator){
  for (  IndicatorUnit indiUnit : meIndicator.getIndicatorUnits()) {
    deleteIndicatorItems(meIndicator,indiUnit);
  }
}
Program: 137521
Project: 137521
Buggy source:
/** 
 * DOC xqliu Comment method "removeUncheckedWhereRuleIndicator". ADD xqliu 2009-04-30 bug 6808
 * @param ownedWhereRuleFiles
 * @param results
 * @param tableIndicator
 * @param whereRuleFolder
 */
private void removeUncheckedWhereRuleIndicator(Object[] ownedWhereRuleFiles,Object[] results,TableIndicator tableIndicator,IFolder whereRuleFolder){
  ArrayList removeList=new ArrayList();
  for (  Object file : ownedWhereRuleFiles) {
    boolean remove=true;
    for (    Object result : results) {
      if (file.equals(result)) {
        remove=false;
        break;
      }
    }
    if (remove) {
      removeList.add(file);
    }
  }
  TableIndicatorUnit[] indicatorUnits=tableIndicator.getIndicatorUnits();
  for (  TableIndicatorUnit unit : indicatorUnits) {
    IndicatorDefinition indicatorDefinition=unit.getIndicator().getIndicatorDefinition();
    if (indicatorDefinition instanceof WhereRule) {
      WhereRule wr=(WhereRule)indicatorDefinition;
      IFile whereRuleFile=ResourceFileMap.findCorrespondingFile(wr);
      for (      Object obj : removeList) {
        IFile file=(IFile)obj;
        if (whereRuleFile.equals(file)) {
          tableIndicator.removeIndicatorUnit(unit);
          removeItemBranch(this.indicatorTreeItemMap.get(unit));
          this.indicatorTreeItemMap.remove(unit);
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "removeUncheckedWhereRuleIndicator". ADD xqliu 2009-04-30 bug 6808
 * @param ownedWhereRuleFiles
 * @param results
 * @param tableIndicator
 * @param whereRuleFolder
 */
private void removeUncheckedWhereRuleIndicator(Object[] ownedWhereRuleFiles,Object[] results,TableIndicator tableIndicator,IFolder whereRuleFolder){
  ArrayList removeList=new ArrayList();
  for (  Object file : ownedWhereRuleFiles) {
    boolean remove=true;
    for (    Object result : results) {
      if (file.equals(result)) {
        remove=false;
        break;
      }
    }
    if (remove) {
      removeList.add(file);
    }
  }
  TableIndicatorUnit[] indicatorUnits=tableIndicator.getIndicatorUnits();
  for (  TableIndicatorUnit unit : indicatorUnits) {
    IndicatorDefinition indicatorDefinition=unit.getIndicator().getIndicatorDefinition();
    if (indicatorDefinition instanceof WhereRule) {
      WhereRule wr=(WhereRule)indicatorDefinition;
      IFile whereRuleFile=ResourceFileMap.findCorrespondingFile(wr);
      for (      Object obj : removeList) {
        IFile file=(IFile)obj;
        if (whereRuleFile.equals(file)) {
          removeItemBranch(this.indicatorTreeItemMap.get(unit));
          deleteIndicatorItems(tableIndicator,unit);
          break;
        }
      }
    }
  }
}
Program: 137522
Project: 137522
Buggy source:
/** 
 * delete all TableIndicatorUnit which contain in the tableIndicator.
 */
private void deleteIndicatorItems(TableIndicator tableIndicator){
  for (  TableIndicatorUnit indiUnit : tableIndicator.getIndicatorUnits()) {
    deleteIndicatorAideItems(tableIndicator,indiUnit);
    tableIndicator.removeIndicatorUnit(indiUnit);
    this.indicatorTreeItemMap.remove(indiUnit);
    addRemovedElements(masterPage.getAnalysis(),indiUnit);
  }
}

Fixed version (ground truth):
/** 
 * delete all TableIndicatorUnit which contain in the tableIndicator.
 */
private void deleteIndicatorItems(TableIndicator tableIndicator){
  for (  TableIndicatorUnit indiUnit : tableIndicator.getIndicatorUnits()) {
    deleteIndicatorAideItems(tableIndicator,indiUnit);
    tableIndicator.removeIndicatorUnit(indiUnit);
    this.indicatorTreeItemMap.remove(indiUnit);
    removedElements(masterPage.getAnalysis(),indiUnit);
  }
}
Program: 137523
Project: 137523
Buggy source:
/** 
 * get full name as: db.catalog.table, if has catalog/schema
 * @param analyzedColumns
 * @param dbmsLanguage
 * @return
 */
public static String getTableName(ModelElement analyzedColumn,DbmsLanguage dbmsLanguage){
  ModelElement columnSetOwner=findColumnSetOwner(analyzedColumn);
  String tableName=columnSetOwner.getName();
  String schemaName=getQuotedSchemaName(columnSetOwner,dbmsLanguage);
  String catalogName=getQuotedCatalogName(columnSetOwner,dbmsLanguage);
  if (catalogName == null && schemaName != null) {
    final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
    final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
    catalogName=parentCatalog != null ? parentCatalog.getName() : null;
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
  }
  DatabaseConnection dbConn=ConnectionHelper.getTdDataProvider(SwitchHelpers.COLUMN_SWITCH.doSwitch(analyzedColumn));
  if (dbConn.isContextMode()) {
    return getTableNameFromContext(dbConn,catalogName,schemaName,tableName,dbmsLanguage);
  }
 else {
    return dbmsLanguage.toQualifiedName(catalogName,schemaName,tableName);
  }
}

Fixed version (ground truth):
/** 
 * get full name as: db.catalog.table, if has catalog/schema
 * @param analyzedColumns
 * @param dbmsLanguage
 * @return
 */
public static String getTableName(ModelElement analyzedColumn,DbmsLanguage dbmsLanguage){
  ModelElement columnSetOwner=findColumnSetOwner(analyzedColumn);
  String tableName=columnSetOwner.getName();
  String schemaName=getQuotedSchemaName(columnSetOwner,dbmsLanguage);
  String catalogName=getQuotedCatalogName(columnSetOwner,dbmsLanguage);
  if (catalogName == null && schemaName != null) {
    final Schema parentSchema=SchemaHelper.getParentSchema(columnSetOwner);
    final Catalog parentCatalog=CatalogHelper.getParentCatalog(parentSchema);
    catalogName=parentCatalog != null ? parentCatalog.getName() : null;
  }
  if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {
    schemaName=ColumnSetHelper.getTableOwner(columnSetOwner);
  }
  DatabaseConnection dbConn=ConnectionHelper.getTdDataProvider(SwitchHelpers.COLUMN_SWITCH.doSwitch(analyzedColumn));
  if (dbConn != null && dbConn.isContextMode()) {
    return getTableNameFromContext(dbConn,catalogName,schemaName,tableName,dbmsLanguage);
  }
 else {
    return dbmsLanguage.toQualifiedName(catalogName,schemaName,tableName);
  }
}
Program: 137524
Project: 137524
Buggy source:
private EmfFileResourceUtil(){
  EMFUtil util=new EMFUtil();
  resourceSet=util.getResourceSet();
  Resource.Factory.Registry reg=Resource.Factory.Registry.INSTANCE;
  reg.getExtensionToFactoryMap().put("String_Node_Str",new CwmResourceFactory());
}

Fixed version (ground truth):
private EmfFileResourceUtil(){
  EMFUtil util=new EMFUtil();
  resourceSet=util.getResourceSet();
  Resource.Factory.Registry reg=Resource.Factory.Registry.INSTANCE;
  CwmResourceFactory cwmFactory=new CwmResourceFactory();
  reg.getExtensionToFactoryMap().put("String_Node_Str",cwmFactory);
  reg.getExtensionToFactoryMap().put("String_Node_Str",cwmFactory);
}
Program: 137525
Project: 137525
Buggy source:
/** 
 * Updata DB_PRODUCT tagged values for connection item in case they are not present in current file.
 * @throws SQLException
 */
public static synchronized void updataTaggedValueForConnectionItem(Connection dataProvider){
  if (dataProvider instanceof DatabaseConnection && StringUtils.isBlank(TaggedValueHelper.getValueString(TaggedValueHelper.DB_PRODUCT_NAME,dataProvider))) {
    Property property=PropertyHelper.getProperty(dataProvider);
    if (property != null) {
      Item item=property.getItem();
      if (item != null) {
        DatabaseConnection dbConn=(DatabaseConnection)dataProvider;
        IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
        dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
        if (dbConn != null) {
          try {
            ProxyRepositoryFactory.getInstance().save(item);
          }
 catch (          PersistenceException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updata DB_PRODUCT tagged values for connection item in case they are not present in current file.
 * @throws SQLException
 */
public static synchronized void updataTaggedValueForConnectionItem(Connection dataProvider){
  if (dataProvider instanceof DatabaseConnection && StringUtils.isBlank(TaggedValueHelper.getValueString(TaggedValueHelper.DB_PRODUCT_NAME,dataProvider))) {
    Property property=PropertyHelper.getProperty(dataProvider);
    if (property != null) {
      Item item=property.getItem();
      if (item != null) {
        DatabaseConnection dbConn=(DatabaseConnection)dataProvider;
        IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
        dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
        if (dbConn != null && Platform.isRunning()) {
          try {
            ProxyRepositoryFactory.getInstance().save(item);
          }
 catch (          PersistenceException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
}
Program: 137528
Project: 137528
Buggy source:
/** 
 * DOC klliu Comment method "checkJavaIndicatorIsEixt".
 * @return
 */
private boolean checkJavaIndicatorIsEixt(){
  String className=this.getClassNameForSave();
  String jarPath=this.getJarPathForSave();
  if (className != null && jarPath != null && !className.trim().equals(PluginConstant.EMPTY_STRING) && !jarPath.trim().equals(PluginConstant.EMPTY_STRING)) {
    for (    IFile file : UDIUtils.getContainJarFile(jarPath)) {
      TalendURLClassLoader cl;
      try {
        cl=new TalendURLClassLoader(new URL[]{file.getLocation().toFile().toURI().toURL()});
        Class<?> theClass=cl.findClass(className);
        if (theClass != null) {
          return true;
        }
      }
 catch (      MalformedURLException e1) {
        Log.error(e1.getStackTrace());
      }
catch (      ClassNotFoundException e1) {
        Log.error(e1.getStackTrace());
      }
    }
    return false;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * DOC klliu Comment method "checkJavaIndicatorIsEixt".
 * @return
 */
private boolean checkJavaIndicatorIsEixt(){
  String className=this.getClassNameForSave();
  String jarPath=this.getJarPathForSave();
  if (className != null && jarPath != null && !className.trim().equals(PluginConstant.EMPTY_STRING) && !jarPath.trim().equals(PluginConstant.EMPTY_STRING)) {
    for (    IFile file : UDIUtils.getContainJarFile(jarPath)) {
      TalendURLClassLoader cl;
      try {
        cl=new TalendURLClassLoader(new URL[]{file.getLocation().toFile().toURI().toURL()},IndicatorDefinitionMaterPage.class.getClassLoader());
        Class<?> theClass=cl.findClass(className);
        if (theClass != null) {
          return true;
        }
      }
 catch (      MalformedURLException e1) {
        Log.error(e1.getStackTrace());
      }
catch (      ClassNotFoundException e1) {
        Log.error(e1.getStackTrace());
      }
    }
    return false;
  }
 else {
    return false;
  }
}
Program: 137529
Project: 137529
Buggy source:
/** 
 * ADD mzhao 11128, try to load by current thread loader.
 */
@Override public Class<?> findClass(String className) throws ClassNotFoundException {
  Class<?> cls=(Class<?>)classesMap.get(className);
  if (cls == null) {
    try {
      cls=super.findClass(className);
    }
 catch (    ClassNotFoundException cne) {
      cls=getClass().getClassLoader().loadClass(className);
    }
    classesMap.put(className,cls);
  }
  return cls;
}

Fixed version (ground truth):
/** 
 * ADD mzhao 11128, try to load by current thread loader.
 */
@Override public Class<?> findClass(String className) throws ClassNotFoundException {
  Class<?> cls=classesMap.get(className);
  if (cls == null) {
    try {
      cls=super.findClass(className);
    }
 catch (    ClassNotFoundException cne) {
      cls=getClass().getClassLoader().loadClass(className);
    }
    classesMap.put(className,cls);
  }
  return cls;
}
Program: 137530
Project: 137530
Buggy source:
/** 
 * DOC zhao mzhao 11128, try to load by current thread loader.
 * @param urls
 */
public TalendURLClassLoader(URL[] urls){
  super(urls,TalendURLClassLoader.class.getClassLoader());
}

Fixed version (ground truth):
/** 
 * The classloader initiated by this contractor will load the class from urls class path , if not find it will use the given classloader to load it.
 * @param urls The url array used to load class.
 * @param classLoader when the class is not found from class path of urls, this classloader will be employeed to load it again.
 */
public TalendURLClassLoader(URL[] urls,ClassLoader classLoader){
  super(urls,classLoader);
}
Program: 137536
Project: 137536
Buggy source:
@Override public void onMatch(Record record1,Record record2,MatchResult matchResult){
  LOGGER.info("String_Node_Str" + record1.getId() + "String_Node_Str"+ record2.getId());
  if (LOGGER.isDebugEnabled()) {
    StringBuilder messagesBuilder=new StringBuilder();
    int i=0;
    for (    MatchResult.Score score : matchResult.getScores()) {
      messagesBuilder.append("String_Node_Str").append(score.algorithm.getComponentValue()).append("String_Node_Str").append(score.values[0]).append("String_Node_Str").append(score.values[1]).append("String_Node_Str").append(score.score).append("String_Node_Str").append(matchResult.getThresholds().get(i)).append("String_Node_Str");
      i++;
    }
    messagesBuilder.append('\n');
    messagesBuilder.append("String_Node_Str").append(matchResult.getNormalizedConfidence());
    messagesBuilder.append("String_Node_Str").append(matchResult.getMinConfidenceValue()).append("String_Node_Str");
    LOGGER.debug(messagesBuilder.toString());
  }
}

Fixed version (ground truth):
@Override public void onMatch(Record record1,Record record2,MatchResult matchResult){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str" + record1.getId() + "String_Node_Str"+ record2.getId());
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder messagesBuilder=new StringBuilder();
    int i=0;
    for (    MatchResult.Score score : matchResult.getScores()) {
      messagesBuilder.append("String_Node_Str").append(score.algorithm.getComponentValue()).append("String_Node_Str").append(score.values[0]).append("String_Node_Str").append(score.values[1]).append("String_Node_Str").append(score.score).append("String_Node_Str").append(matchResult.getThresholds().get(i)).append("String_Node_Str");
      i++;
    }
    messagesBuilder.append('\n');
    messagesBuilder.append("String_Node_Str").append(matchResult.getNormalizedConfidence());
    messagesBuilder.append("String_Node_Str").append(matchResult.getMinConfidenceValue()).append("String_Node_Str");
    LOGGER.debug(messagesBuilder.toString());
  }
}
Program: 137537
Project: 137537
Buggy source:
@Override public void onDifferent(Record record1,Record record2,MatchResult matchResult){
  LOGGER.info("String_Node_Str" + record1.getId() + "String_Node_Str"+ record2.getId());
  if (LOGGER.isDebugEnabled()) {
    StringBuilder messagesBuilder=new StringBuilder();
    int i=0;
    for (    MatchResult.Score score : matchResult.getScores()) {
      Float threshold=matchResult.getThresholds().get(i);
      String compareSymbol;
      if (score.score < threshold) {
        compareSymbol="String_Node_Str";
      }
 else {
        compareSymbol="String_Node_Str";
      }
      messagesBuilder.append("String_Node_Str").append(score.algorithm.getComponentValue()).append("String_Node_Str").append(score.values[0]).append("String_Node_Str").append(score.values[1]).append("String_Node_Str").append(score.score).append("String_Node_Str").append(compareSymbol).append("String_Node_Str").append(threshold).append("String_Node_Str");
      i++;
    }
    messagesBuilder.append('\n');
    messagesBuilder.append("String_Node_Str").append(matchResult.getNormalizedConfidence());
    messagesBuilder.append("String_Node_Str").append(matchResult.getMinConfidenceValue()).append("String_Node_Str");
    LOGGER.debug(messagesBuilder.toString());
  }
}

Fixed version (ground truth):
@Override public void onDifferent(Record record1,Record record2,MatchResult matchResult){
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str" + record1.getId() + "String_Node_Str"+ record2.getId());
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder messagesBuilder=new StringBuilder();
    int i=0;
    for (    MatchResult.Score score : matchResult.getScores()) {
      Float threshold=matchResult.getThresholds().get(i);
      String compareSymbol;
      if (score.score < threshold) {
        compareSymbol="String_Node_Str";
      }
 else {
        compareSymbol="String_Node_Str";
      }
      messagesBuilder.append("String_Node_Str").append(score.algorithm.getComponentValue()).append("String_Node_Str").append(score.values[0]).append("String_Node_Str").append(score.values[1]).append("String_Node_Str").append(score.score).append("String_Node_Str").append(compareSymbol).append("String_Node_Str").append(threshold).append("String_Node_Str");
      i++;
    }
    messagesBuilder.append('\n');
    messagesBuilder.append("String_Node_Str").append(matchResult.getNormalizedConfidence());
    messagesBuilder.append("String_Node_Str").append(matchResult.getMinConfidenceValue()).append("String_Node_Str");
    LOGGER.debug(messagesBuilder.toString());
  }
}