Program: 137275
Project: 137275
Buggy source:
@Test public void testDoGroupMergeValues() 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 survivorShipAlgorithmParams=new SurvivorShipAlgorithmParams();
  SurvivorshipFunction func=survivorShipAlgorithmParams.new SurvivorshipFunction();
  func.setParameter("String_Node_Str");
  func.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  survivorShipAlgorithmParams.setSurviorShipAlgos(new SurvivorshipFunction[]{func});
  recordGroup.setSurvivorShipAlgorithmParams(survivorShipAlgorithmParams);
  Map<Integer,SurvivorshipFunction> defaultSurvRules=new HashMap<Integer,SurvivorshipFunction>();
  SurvivorshipFunction survFunc=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc.setParameter(StringUtils.EMPTY);
  survFunc.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  defaultSurvRules.put(0,survFunc);
  SurvivorshipFunction survFunc2=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc2.setParameter(StringUtils.EMPTY);
  survFunc2.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.LONGEST);
  defaultSurvRules.put(2,survFunc2);
  SurvivorshipFunction survFunc3=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc3.setParameter(StringUtils.EMPTY);
  survFunc3.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  defaultSurvRules.put(3,survFunc3);
  SurvivorshipFunction survFunc4=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc4.setParameter(StringUtils.EMPTY);
  survFunc4.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.LARGEST);
  defaultSurvRules.put(4,survFunc4);
  SurvivorshipFunction survFunc5=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc5.setParameter(StringUtils.EMPTY);
  survFunc5.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_RECENT);
  defaultSurvRules.put(5,survFunc5);
  SurvivorshipFunction survFunc6=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc6.setParameter(StringUtils.EMPTY);
  survFunc6.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  defaultSurvRules.put(6,survFunc6);
  survivorShipAlgorithmParams.setDefaultSurviorshipRules(defaultSurvRules);
  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(1));
  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[10].equals("String_Node_Str")) {
      Assert.assertEquals(4,Integer.valueOf(rds[rds.length - 5]).intValue());
      Assert.assertEquals(0.9666666746139526,Double.valueOf(rds[rds.length - 2]).doubleValue(),0d);
      Assert.assertEquals("String_Node_Str",rds[1]);
      Assert.assertEquals("String_Node_Str",rds[2]);
      Assert.assertEquals("String_Node_Str",rds[3]);
      Assert.assertEquals("String_Node_Str",rds[4]);
      Assert.assertEquals("String_Node_Str",rds[5]);
    }
  }
}

Fixed version (ground truth):
@Test public void testDoGroupMergeValues() 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 survivorShipAlgorithmParams=new SurvivorShipAlgorithmParams();
  SurvivorshipFunction func=survivorShipAlgorithmParams.new SurvivorshipFunction();
  func.setParameter("String_Node_Str");
  func.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  survivorShipAlgorithmParams.setSurviorShipAlgos(new SurvivorshipFunction[]{func});
  recordGroup.setSurvivorShipAlgorithmParams(survivorShipAlgorithmParams);
  Map<Integer,SurvivorshipFunction> defaultSurvRules=new HashMap<Integer,SurvivorshipFunction>();
  SurvivorshipFunction survFunc=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc.setParameter(StringUtils.EMPTY);
  survFunc.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  defaultSurvRules.put(0,survFunc);
  SurvivorshipFunction survFunc2=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc2.setParameter(StringUtils.EMPTY);
  survFunc2.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.LONGEST);
  defaultSurvRules.put(2,survFunc2);
  SurvivorshipFunction survFunc3=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc3.setParameter(StringUtils.EMPTY);
  survFunc3.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  defaultSurvRules.put(3,survFunc3);
  SurvivorshipFunction survFunc4=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc4.setParameter(StringUtils.EMPTY);
  survFunc4.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.LARGEST);
  defaultSurvRules.put(4,survFunc4);
  SurvivorshipFunction survFunc5=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc5.setParameter(StringUtils.EMPTY);
  survFunc5.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_RECENT);
  defaultSurvRules.put(5,survFunc5);
  SurvivorshipFunction survFunc6=survivorShipAlgorithmParams.new SurvivorshipFunction();
  survFunc6.setParameter(StringUtils.EMPTY);
  survFunc6.setSurvivorShipAlgoEnum(SurvivorShipAlgorithmEnum.MOST_COMMON);
  defaultSurvRules.put(6,survFunc6);
  survivorShipAlgorithmParams.setDefaultSurviorshipRules(defaultSurvRules);
  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(1));
  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(0.9));
  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[10].equals("String_Node_Str")) {
      Assert.assertEquals(4,Integer.valueOf(rds[rds.length - 5]).intValue());
      Assert.assertEquals(0.9666666746139526,Double.valueOf(rds[rds.length - 2]).doubleValue(),0d);
      Assert.assertEquals("String_Node_Str",rds[1]);
      Assert.assertEquals("String_Node_Str",rds[2]);
      Assert.assertEquals("String_Node_Str",rds[3]);
      Assert.assertEquals("String_Node_Str",rds[4]);
      Assert.assertEquals("String_Node_Str",rds[5]);
    }
  }
}