Program: 12973
Project: 12973
Buggy source:
/** 
 * ` Executes an author name matching algorithm for author disambiguation
 * @param minChars minimum number of chars to require for first name portion of match 
 */
public void authorNameMatch(int minChars){
  String queryString;
  Resource paperResource;
  RDFNode lastNameNode;
  RDFNode foreNameNode;
  RDFNode paperNode;
  RDFNode authorNode=null;
  RDFNode matchNode=null;
  RDFNode loopNode;
  ResultSet vivoResult;
  QuerySolution scoreSolution;
  QuerySolution vivoSolution;
  ResultSet scoreInputResult;
  String scoreMatch;
  ArrayList<QuerySolution> matchNodes=new ArrayList<QuerySolution>();
  int loop;
  String matchQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  log.info("String_Node_Str");
  log.debug(matchQuery);
  scoreInputResult=executeQuery(this.scoreInput,matchQuery);
  if (!scoreInputResult.hasNext()) {
    log.info("String_Node_Str");
  }
 else {
    log.info("String_Node_Str");
  }
  while (scoreInputResult.hasNext()) {
    scoreSolution=scoreInputResult.next();
    lastNameNode=scoreSolution.get("String_Node_Str");
    foreNameNode=scoreSolution.get("String_Node_Str");
    paperNode=scoreSolution.get("String_Node_Str");
    paperResource=scoreSolution.getResource("String_Node_Str");
    matchNodes.clear();
    matchNode=null;
    authorNode=null;
    log.info("String_Node_Str" + lastNameNode.toString() + "String_Node_Str"+ foreNameNode.toString()+ "String_Node_Str"+ paperNode.toString()+ "String_Node_Str");
    scoreMatch=lastNameNode.toString();
    queryString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + scoreMatch + "String_Node_Str";
    log.debug(queryString);
    vivoResult=executeQuery(this.vivo,queryString);
    while (vivoResult.hasNext()) {
      vivoSolution=vivoResult.next();
      log.trace(vivoSolution.toString());
      loopNode=vivoSolution.get("String_Node_Str");
      if (loopNode != null && foreNameNode != null) {
        log.trace("String_Node_Str" + loopNode);
        if (foreNameNode.toString().substring(0,1).equals(loopNode.toString().substring(0,1))) {
          matchNodes.add(vivoSolution);
        }
 else {
        }
      }
    }
    Iterator<QuerySolution> matches=matchNodes.iterator();
    while (matches.hasNext()) {
      vivoSolution=matches.next();
      loopNode=vivoSolution.get("String_Node_Str");
      loop=0;
      while (loopNode.toString().regionMatches(true,0,foreNameNode.toString(),0,loop)) {
        loop++;
      }
      loop--;
      if (loop < minChars) {
        log.trace(loopNode.toString() + "String_Node_Str" + loop+ "String_Node_Str"+ foreNameNode.toString().length()+ "String_Node_Str"+ minChars);
      }
 else {
        if (matchNode == null || !matchNode.toString().regionMatches(true,0,foreNameNode.toString(),0,loop)) {
          log.trace("String_Node_Str" + loopNode.toString() + "String_Node_Str"+ loop+ "String_Node_Str"+ foreNameNode.toString().length());
          matchNode=loopNode;
          authorNode=vivoSolution.get("String_Node_Str");
        }
      }
    }
    if (matchNode != null && authorNode != null) {
      log.trace("String_Node_Str" + matchNode.toString());
      commitResultNode(this.scoreOutput,authorNode,paperResource,matchNode,paperNode);
    }
  }
}

Fixed version (ground truth):
/** 
 * ` Executes an author name matching algorithm for author disambiguation
 * @param minChars minimum number of chars to require for first name portion of match 
 */
public void authorNameMatch(int minChars){
  String queryString;
  Resource paperResource;
  RDFNode lastNameNode;
  RDFNode foreNameNode;
  RDFNode paperNode;
  RDFNode authorNode=null;
  RDFNode matchNode=null;
  RDFNode loopNode;
  ResultSet vivoResult;
  QuerySolution scoreSolution;
  QuerySolution vivoSolution;
  ResultSet scoreInputResult;
  String scoreMatch;
  ArrayList<QuerySolution> matchNodes=new ArrayList<QuerySolution>();
  int loop;
  String matchQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  log.info("String_Node_Str");
  log.debug(matchQuery);
  scoreInputResult=executeQuery(this.scoreInput,matchQuery);
  if (!scoreInputResult.hasNext()) {
    log.info("String_Node_Str");
  }
 else {
    log.info("String_Node_Str");
  }
  while (scoreInputResult.hasNext()) {
    scoreSolution=scoreInputResult.next();
    lastNameNode=scoreSolution.get("String_Node_Str");
    foreNameNode=scoreSolution.get("String_Node_Str");
    paperNode=scoreSolution.get("String_Node_Str");
    paperResource=scoreSolution.getResource("String_Node_Str");
    matchNodes.clear();
    matchNode=null;
    authorNode=null;
    log.info("String_Node_Str" + lastNameNode.toString() + "String_Node_Str"+ foreNameNode.toString()+ "String_Node_Str"+ paperNode.toString()+ "String_Node_Str");
    scoreMatch=lastNameNode.toString();
    queryString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + scoreMatch + "String_Node_Str";
    log.debug(queryString);
    vivoResult=executeQuery(this.vivo,queryString);
    while (vivoResult.hasNext()) {
      vivoSolution=vivoResult.next();
      log.trace(vivoSolution.toString());
      loopNode=vivoSolution.get("String_Node_Str");
      if (loopNode.toString() != null && foreNameNode.toString() != null) {
        log.trace("String_Node_Str" + loopNode);
        if (foreNameNode.toString().substring(0,1).equals(loopNode.toString().substring(0,1))) {
          matchNodes.add(vivoSolution);
        }
 else {
        }
      }
    }
    Iterator<QuerySolution> matches=matchNodes.iterator();
    while (matches.hasNext()) {
      vivoSolution=matches.next();
      loopNode=vivoSolution.get("String_Node_Str");
      loop=0;
      while (loopNode.toString().regionMatches(true,0,foreNameNode.toString(),0,loop)) {
        loop++;
      }
      loop--;
      if (loop < minChars) {
        log.trace(loopNode.toString() + "String_Node_Str" + loop+ "String_Node_Str"+ foreNameNode.toString().length()+ "String_Node_Str"+ minChars);
      }
 else {
        if (matchNode == null || !matchNode.toString().regionMatches(true,0,foreNameNode.toString(),0,loop)) {
          log.trace("String_Node_Str" + loopNode.toString() + "String_Node_Str"+ loop+ "String_Node_Str"+ foreNameNode.toString().length());
          matchNode=loopNode;
          authorNode=vivoSolution.get("String_Node_Str");
        }
      }
    }
    if (matchNode != null && authorNode != null) {
      log.trace("String_Node_Str" + matchNode.toString());
      commitResultNode(this.scoreOutput,authorNode,paperResource,matchNode,paperNode);
    }
  }
}