Program: 137547
Project: 137547
Buggy source:
private MatchResult matchRecords(Record mergedRecord,Record currentRecord){
  if (mergedRecord.getAttributes().size() != currentRecord.getAttributes().size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (mergedRecord.getGroupId() != null && currentRecord.getGroupId() != null) {
    if (!mergedRecord.getGroupId().equals(currentRecord.getGroupId())) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str");
      }
      return NonMatchResult.INSTANCE;
    }
 else {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str");
      }
    }
  }
  Iterator<Attribute> mergedRecordAttributes=mergedRecord.getAttributes().iterator();
  Iterator<Attribute> currentRecordAttributes=currentRecord.getAttributes().iterator();
  double confidence=0;
  int matchIndex=0;
  MatchResult result=new MatchResult();
  while (mergedRecordAttributes.hasNext()) {
    Attribute left=mergedRecordAttributes.next();
    Attribute right=currentRecordAttributes.next();
    double score=MatchMerge.matchScore(left,right,algorithms[matchIndex],nullOptions[matchIndex],subStrings[matchIndex]);
    result.setScore(matchIndex,algorithms[matchIndex],score,left.getValue(),right.getValue());
    result.setThreshold(matchIndex,thresholds[matchIndex]);
    confidence+=score * weights[matchIndex];
    matchIndex++;
  }
  double normalizedConfidence=confidence > 0 ? confidence / maxWeight : confidence;
  result.setConfidence(normalizedConfidence,minConfidenceValue);
  if (normalizedConfidence < minConfidenceValue) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str" + normalizedConfidence + "String_Node_Str"+ minConfidenceValue+ "String_Node_Str");
    }
    return NonMatchResult.wrap(result);
  }
  currentRecord.setConfidence(normalizedConfidence);
  return result;
}

Fixed version (ground truth):
private MatchResult matchRecords(Record mergedRecord,Record currentRecord){
  if (mergedRecord.getAttributes().size() != currentRecord.getAttributes().size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (mergedRecord.getGroupId() != null && currentRecord.getGroupId() != null) {
    if (!mergedRecord.getGroupId().equals(currentRecord.getGroupId())) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str");
      }
      return NonMatchResult.INSTANCE;
    }
 else {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str");
      }
    }
  }
  Iterator<Attribute> mergedRecordAttributes=mergedRecord.getAttributes().iterator();
  Iterator<Attribute> currentRecordAttributes=currentRecord.getAttributes().iterator();
  double confidence=0;
  int matchIndex=0;
  MatchResult result=new MatchResult(mergedRecord.getAttributes().size());
  while (mergedRecordAttributes.hasNext()) {
    Attribute left=mergedRecordAttributes.next();
    Attribute right=currentRecordAttributes.next();
    double score=MatchMerge.matchScore(left,right,algorithms[matchIndex],nullOptions[matchIndex],subStrings[matchIndex]);
    result.setScore(matchIndex,algorithms[matchIndex],score,left.getValue(),right.getValue());
    result.setThreshold(matchIndex,thresholds[matchIndex]);
    confidence+=score * weights[matchIndex];
    matchIndex++;
  }
  double normalizedConfidence=confidence > 0 ? confidence / maxWeight : confidence;
  result.setConfidence(normalizedConfidence,minConfidenceValue);
  if (normalizedConfidence < minConfidenceValue) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str" + normalizedConfidence + "String_Node_Str"+ minConfidenceValue+ "String_Node_Str");
    }
    return NonMatchResult.wrap(result);
  }
  currentRecord.setConfidence(normalizedConfidence);
  return result;
}