Program: 137274
Project: 137274
Buggy source:
@Test public void testDoGroup() throws IOException {
  InputStream in=this.getClass().getResourceAsStream("String_Node_Str");
  BufferedReader bfr=new BufferedReader(new InputStreamReader(in));
  List<String> listOfLines=IOUtils.readLines(bfr);
  inputList=new ArrayList<String[]>();
  for (  String line : listOfLines) {
    String[] fields=StringUtils.splitPreserveAllTokens(line,columnDelimiter);
    inputList.add(fields);
  }
  recordGroup=new AbstractRecordGrouping<String>(){
    @Override protected boolean isMaster(    String col){
      return "String_Node_Str".equals(col);
    }
    @Override protected String[] createTYPEArray(    int size){
      return new String[size];
    }
    @Override protected void outputRow(    String[] row){
      for (      String c : row) {
        System.out.print(c + "String_Node_Str");
      }
      System.out.println();
      groupingRecords.add(row);
    }
    @Override protected void outputRow(    RichRecord row){
      List<DQAttribute<?>> originRow=row.getOutputRow(swooshGrouping.getOldGID2New());
      String[] strRow=new String[originRow.size()];
      int idx=0;
      for (      DQAttribute<?> attr : originRow) {
        strRow[idx]=attr.getValue();
        idx++;
      }
      outputRow(strRow);
    }
    @Override protected String incrementGroupSize(    String oldGroupSize){
      return String.valueOf(Integer.parseInt(String.valueOf(oldGroupSize)) + 1);
    }
    @Override protected String castAsType(    Object objectValue){
      return String.valueOf(objectValue);
    }
  }
;
  recordGroup.setRecordLinkAlgorithm(RecordMatcherType.T_SwooshAlgorithm);
  SurvivorShipAlgorithmParams survAlgParams=new SurvivorShipAlgorithmParams();
  SurvivorshipFunction func=survAlgParams.new SurvivorshipFunction();
  func.setParameter("String_Node_Str");
  func.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  survAlgParams.setSurviorShipAlgos(new SurvivorshipFunction[]{func});
  Map<Integer,SurvivorshipFunction> defaultSurvRules=new HashMap<Integer,SurvivorshipFunction>();
  SurvivorshipFunction survFunc=survAlgParams.new SurvivorshipFunction();
  survFunc.setParameter(StringUtils.EMPTY);
  survFunc.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.LONGEST);
  defaultSurvRules.put(1,survFunc);
  survAlgParams.setDefaultSurviorshipRules(defaultSurvRules);
  recordGroup.setSurvivorShipAlgorithmParams(survAlgParams);
  recordGroup.setColumnDelimiter(columnDelimiter);
  recordGroup.setIsLinkToPrevious(Boolean.FALSE);
  List<Map<String,String>> matchingRule=new ArrayList<Map<String,String>>();
  Map<String,String> lnameRecords=new HashMap<String,String>();
  lnameRecords.put(IRecordGrouping.COLUMN_IDX,String.valueOf(0));
  lnameRecords.put(IRecordGrouping.ATTRIBUTE_NAME,"String_Node_Str");
  lnameRecords.put(IRecordGrouping.MATCHING_TYPE,"String_Node_Str");
  lnameRecords.put(IRecordGrouping.CONFIDENCE_WEIGHT,String.valueOf(1));
  matchingRule.add(lnameRecords);
  recordGroup.addMatchRule(matchingRule);
  try {
    recordGroup.initialize();
  }
 catch (  InstantiationException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
catch (  IllegalAccessException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
catch (  ClassNotFoundException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
  recordGroup.setIsOutputDistDetails(true);
  recordGroup.setAcceptableThreshold(0.95f);
  try {
    for (    String[] inputRow : inputList) {
      recordGroup.doGroup(inputRow);
    }
    recordGroup.end();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  InterruptedException e) {
    log.error(e.getMessage(),e);
  }
  for (  String[] rds : groupingRecords) {
    if (rds[0].equals("String_Node_Str") && rds[11].equals("String_Node_Str")) {
      Assert.assertEquals(2,Integer.valueOf(rds[rds.length - 5]).intValue());
    }
 else     if (rds[0].equals("String_Node_Str") && rds[11].equals("String_Node_Str")) {
      Assert.assertEquals(2,Integer.valueOf(rds[rds.length - 5]).intValue());
    }
 else     if (rds[0].equals("String_Node_Str") && rds[11].equals("String_Node_Str")) {
      Assert.assertEquals(3,Integer.valueOf(rds[rds.length - 5]).intValue());
    }
  }
}

Fixed version (ground truth):
@Test public void testDoGroup() throws IOException {
  InputStream in=this.getClass().getResourceAsStream("String_Node_Str");
  BufferedReader bfr=new BufferedReader(new InputStreamReader(in));
  List<String> listOfLines=IOUtils.readLines(bfr);
  inputList=new ArrayList<String[]>();
  for (  String line : listOfLines) {
    String[] fields=StringUtils.splitPreserveAllTokens(line,columnDelimiter);
    inputList.add(fields);
  }
  recordGroup=new AbstractRecordGrouping<String>(){
    @Override protected boolean isMaster(    String col){
      return "String_Node_Str".equals(col);
    }
    @Override protected String[] createTYPEArray(    int size){
      return new String[size];
    }
    @Override protected void outputRow(    String[] row){
      for (      String c : row) {
        System.out.print(c + "String_Node_Str");
      }
      System.out.println();
      groupingRecords.add(row);
    }
    @Override protected void outputRow(    RichRecord row){
      List<DQAttribute<?>> originRow=row.getOutputRow(swooshGrouping.getOldGID2New());
      String[] strRow=new String[originRow.size()];
      int idx=0;
      for (      DQAttribute<?> attr : originRow) {
        strRow[idx]=attr.getValue();
        idx++;
      }
      outputRow(strRow);
    }
    @Override protected String incrementGroupSize(    String oldGroupSize){
      return String.valueOf(Integer.parseInt(String.valueOf(oldGroupSize)) + 1);
    }
    @Override protected String castAsType(    Object objectValue){
      return String.valueOf(objectValue);
    }
  }
;
  recordGroup.setRecordLinkAlgorithm(RecordMatcherType.T_SwooshAlgorithm);
  SurvivorShipAlgorithmParams survAlgParams=new SurvivorShipAlgorithmParams();
  SurvivorshipFunction func=survAlgParams.new SurvivorshipFunction();
  func.setParameter("String_Node_Str");
  func.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  survAlgParams.setSurviorShipAlgos(new SurvivorshipFunction[]{func});
  Map<Integer,SurvivorshipFunction> defaultSurvRules=new HashMap<Integer,SurvivorshipFunction>();
  SurvivorshipFunction survFunc=survAlgParams.new SurvivorshipFunction();
  survFunc.setParameter(StringUtils.EMPTY);
  survFunc.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.LONGEST);
  defaultSurvRules.put(1,survFunc);
  survAlgParams.setDefaultSurviorshipRules(defaultSurvRules);
  recordGroup.setSurvivorShipAlgorithmParams(survAlgParams);
  recordGroup.setColumnDelimiter(columnDelimiter);
  recordGroup.setIsLinkToPrevious(Boolean.FALSE);
  List<Map<String,String>> matchingRule=new ArrayList<Map<String,String>>();
  Map<String,String> lnameRecords=new HashMap<String,String>();
  lnameRecords.put(IRecordGrouping.COLUMN_IDX,String.valueOf(0));
  lnameRecords.put(IRecordGrouping.ATTRIBUTE_NAME,"String_Node_Str");
  lnameRecords.put(IRecordGrouping.MATCHING_TYPE,"String_Node_Str");
  lnameRecords.put(IRecordGrouping.CONFIDENCE_WEIGHT,String.valueOf(1));
  lnameRecords.put(IRecordGrouping.ATTRIBUTE_THRESHOLD,String.valueOf(1));
  matchingRule.add(lnameRecords);
  recordGroup.addMatchRule(matchingRule);
  try {
    recordGroup.initialize();
  }
 catch (  InstantiationException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
catch (  IllegalAccessException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
catch (  ClassNotFoundException e) {
    log.error(e.getMessage(),e);
    Assert.fail();
  }
  recordGroup.setIsOutputDistDetails(true);
  recordGroup.setAcceptableThreshold(0.95f);
  try {
    for (    String[] inputRow : inputList) {
      recordGroup.doGroup(inputRow);
    }
    recordGroup.end();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
catch (  InterruptedException e) {
    log.error(e.getMessage(),e);
  }
  for (  String[] rds : groupingRecords) {
    if (rds[0].equals("String_Node_Str") && rds[11].equals("String_Node_Str")) {
      Assert.assertEquals(2,Integer.valueOf(rds[rds.length - 5]).intValue());
    }
 else     if (rds[0].equals("String_Node_Str") && rds[11].equals("String_Node_Str")) {
      Assert.assertEquals(2,Integer.valueOf(rds[rds.length - 5]).intValue());
    }
 else     if (rds[0].equals("String_Node_Str") && rds[11].equals("String_Node_Str")) {
      Assert.assertEquals(3,Integer.valueOf(rds[rds.length - 5]).intValue());
    }
  }
}