Program: 12966
Project: 12966
Buggy source:
/** 
 * Find all nodes in the given namepsace matching on the given predicates
 * @throws IOException error connecting to dataset
 */
private void match() throws IOException {
  StringBuilder sQuery=new StringBuilder("String_Node_Str" + "String_Node_Str");
  StringBuilder vivoOptionals=new StringBuilder();
  StringBuilder inputOptionals=new StringBuilder();
  List<String> filters=new ArrayList<String>();
  List<String> vivoUnions=new ArrayList<String>();
  List<String> inputUnions=new ArrayList<String>();
  for (  String runName : this.inputPredicates.keySet()) {
    String inputProperty=this.inputPredicates.get(runName);
    String vivoProperty=this.vivoPredicates.get(runName);
    sQuery.append("String_Node_Str" + runName);
    sQuery.append("String_Node_Str" + runName);
    vivoUnions.add("String_Node_Str" + inputProperty + "String_Node_Str"+ runName+ "String_Node_Str");
    vivoOptionals.append("String_Node_Str").append(inputProperty).append("String_Node_Str").append("String_Node_Str" + runName).append("String_Node_Str");
    inputUnions.add("String_Node_Str" + vivoProperty + "String_Node_Str"+ runName+ "String_Node_Str");
    inputOptionals.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str").append(vivoProperty).append("String_Node_Str").append("String_Node_Str" + runName).append("String_Node_Str" + "String_Node_Str");
    filters.add("String_Node_Str" + runName + "String_Node_Str"+ runName+ "String_Node_Str");
  }
  sQuery.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  sQuery.append("String_Node_Str");
  sQuery.append(StringUtils.join(vivoUnions,"String_Node_Str"));
  sQuery.append("String_Node_Str");
  sQuery.append(vivoOptionals.toString());
  sQuery.append("String_Node_Str");
  sQuery.append("String_Node_Str" + "String_Node_Str");
  sQuery.append(StringUtils.join(inputUnions,"String_Node_Str"));
  sQuery.append("String_Node_Str");
  sQuery.append(inputOptionals.toString());
  sQuery.append("String_Node_Str");
  sQuery.append("String_Node_Str");
  sQuery.append(StringUtils.join(filters,"String_Node_Str"));
  sQuery.append("String_Node_Str");
  if (this.namespace != null) {
    sQuery.append("String_Node_Str" + this.namespace + "String_Node_Str");
  }
  sQuery.append("String_Node_Str");
  sQuery.append("String_Node_Str");
  log.debug("String_Node_Str" + sQuery.toString());
  JenaConnect unionModel=new MemJenaConnect();
  JenaConnect vivoClone=unionModel.neighborConnectClone("String_Node_Str");
  vivoClone.loadRdfFromJC(this.vivo);
  JenaConnect inputClone=unionModel.neighborConnectClone("String_Node_Str");
  inputClone.loadRdfFromJC(this.input);
  Dataset ds=unionModel.getConnectionDataSet();
  Query query=QueryFactory.create(sQuery.toString(),Syntax.syntaxARQ);
  QueryExecution queryExec=QueryExecutionFactory.create(query,ds);
  for (  QuerySolution solution : IterableAdaptor.adapt(queryExec.execSelect())) {
    String sInputURI=solution.getResource("String_Node_Str").getURI();
    String sVivoURI=solution.getResource("String_Node_Str").getURI();
    StringBuilder rdf=new StringBuilder();
    rdf.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + sVivoURI + "String_Node_Str"+ "String_Node_Str"+ sInputURI+ "String_Node_Str");
    log.debug("String_Node_Str" + sInputURI + "String_Node_Str"+ sVivoURI+ "String_Node_Str");
    for (    String runName : this.vivoPredicates.keySet()) {
      RDFNode os=solution.get("String_Node_Str" + runName);
      RDFNode op=solution.get("String_Node_Str" + runName);
      log.debug("String_Node_Str" + runName + "String_Node_Str"+ os);
      log.debug("String_Node_Str" + runName + "String_Node_Str"+ op);
      double score=0 / 1;
      if (os != null && op != null) {
        if (os.isResource() && op.isResource() && os.asResource().getURI().equals(op.asResource().getURI())) {
          score=1 / 1;
        }
 else         if (os.isLiteral() && op.isLiteral()) {
          String osStrValue=os.asLiteral().getValue().toString();
          String opStrValue=op.asLiteral().getValue().toString();
          Algorithm alg;
          try {
            alg=this.algorithms.get(runName).newInstance();
          }
 catch (          IllegalAccessException e) {
            throw new IllegalArgumentException(e.getMessage(),e);
          }
catch (          InstantiationException e) {
            throw new IllegalArgumentException(e.getMessage(),e);
          }
          score=alg.calculate(osStrValue,opStrValue);
        }
      }
      double weight=this.weights.get(runName).doubleValue();
      rdf.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + this.vivoPredicates.get(runName) + "String_Node_Str"+ "String_Node_Str"+ this.inputPredicates.get(runName)+ "String_Node_Str"+ "String_Node_Str"+ this.algorithms.get(runName).getName()+ "String_Node_Str"+ "String_Node_Str"+ score+ "String_Node_Str"+ "String_Node_Str"+ weight+ "String_Node_Str"+ "String_Node_Str"+ (weight * score)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    }
    rdf.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    log.debug("String_Node_Str" + sInputURI + "String_Node_Str"+ sVivoURI+ "String_Node_Str"+ rdf.toString());
    this.scoreData.loadRdfFromString(rdf.toString(),null,null);
  }
}

Fixed version (ground truth):
/** 
 * Find all nodes in the given namepsace matching on the given predicates
 * @throws IOException error connecting to dataset
 */
private void match() throws IOException {
  StringBuilder sQuery=new StringBuilder("String_Node_Str" + "String_Node_Str");
  StringBuilder vivoOptionals=new StringBuilder();
  StringBuilder inputOptionals=new StringBuilder();
  List<String> filters=new ArrayList<String>();
  List<String> vivoUnions=new ArrayList<String>();
  List<String> inputUnions=new ArrayList<String>();
  for (  String runName : this.inputPredicates.keySet()) {
    String vivoProperty=this.vivoPredicates.get(runName);
    String inputProperty=this.inputPredicates.get(runName);
    sQuery.append("String_Node_Str" + runName);
    sQuery.append("String_Node_Str" + runName);
    vivoUnions.add("String_Node_Str" + vivoProperty + "String_Node_Str"+ runName+ "String_Node_Str");
    vivoOptionals.append("String_Node_Str").append(vivoProperty).append("String_Node_Str").append("String_Node_Str" + runName).append("String_Node_Str");
    inputUnions.add("String_Node_Str" + inputProperty + "String_Node_Str"+ runName+ "String_Node_Str");
    inputOptionals.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str").append(inputProperty).append("String_Node_Str").append("String_Node_Str" + runName).append("String_Node_Str" + "String_Node_Str");
    filters.add("String_Node_Str" + runName + "String_Node_Str"+ runName+ "String_Node_Str");
  }
  sQuery.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  sQuery.append("String_Node_Str");
  sQuery.append(StringUtils.join(vivoUnions,"String_Node_Str"));
  sQuery.append("String_Node_Str");
  sQuery.append(vivoOptionals.toString());
  sQuery.append("String_Node_Str");
  sQuery.append("String_Node_Str" + "String_Node_Str");
  sQuery.append(StringUtils.join(inputUnions,"String_Node_Str"));
  sQuery.append("String_Node_Str");
  sQuery.append(inputOptionals.toString());
  sQuery.append("String_Node_Str");
  sQuery.append("String_Node_Str");
  sQuery.append(StringUtils.join(filters,"String_Node_Str"));
  sQuery.append("String_Node_Str");
  if (this.namespace != null) {
    sQuery.append("String_Node_Str" + this.namespace + "String_Node_Str");
  }
  sQuery.append("String_Node_Str");
  sQuery.append("String_Node_Str");
  log.debug("String_Node_Str" + sQuery.toString());
  JenaConnect unionModel=new MemJenaConnect();
  JenaConnect vivoClone=unionModel.neighborConnectClone("String_Node_Str");
  vivoClone.loadRdfFromJC(this.vivo);
  JenaConnect inputClone=unionModel.neighborConnectClone("String_Node_Str");
  inputClone.loadRdfFromJC(this.input);
  Dataset ds=unionModel.getConnectionDataSet();
  Query query=QueryFactory.create(sQuery.toString(),Syntax.syntaxARQ);
  QueryExecution queryExec=QueryExecutionFactory.create(query,ds);
  for (  QuerySolution solution : IterableAdaptor.adapt(queryExec.execSelect())) {
    String sInputURI=solution.getResource("String_Node_Str").getURI();
    String sVivoURI=solution.getResource("String_Node_Str").getURI();
    StringBuilder rdf=new StringBuilder();
    rdf.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + sVivoURI + "String_Node_Str"+ "String_Node_Str"+ sInputURI+ "String_Node_Str");
    log.debug("String_Node_Str" + sInputURI + "String_Node_Str"+ sVivoURI+ "String_Node_Str");
    for (    String runName : this.vivoPredicates.keySet()) {
      RDFNode os=solution.get("String_Node_Str" + runName);
      RDFNode op=solution.get("String_Node_Str" + runName);
      double score=0 / 1;
      if (os != null && op != null) {
        if (os.isResource() && op.isResource() && os.asResource().getURI().equals(op.asResource().getURI())) {
          score=1 / 1;
        }
 else         if (os.isLiteral() && op.isLiteral()) {
          String osStrValue=os.asLiteral().getValue().toString();
          String opStrValue=op.asLiteral().getValue().toString();
          Algorithm alg;
          try {
            alg=this.algorithms.get(runName).newInstance();
          }
 catch (          IllegalAccessException e) {
            throw new IllegalArgumentException(e.getMessage(),e);
          }
catch (          InstantiationException e) {
            throw new IllegalArgumentException(e.getMessage(),e);
          }
          score=alg.calculate(osStrValue,opStrValue);
        }
      }
      log.trace("String_Node_Str" + runName + "String_Node_Str"+ os+ "String_Node_Str");
      log.trace("String_Node_Str" + runName + "String_Node_Str"+ op+ "String_Node_Str");
      log.trace("String_Node_Str" + score);
      double weight=this.weights.get(runName).doubleValue();
      rdf.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + this.vivoPredicates.get(runName) + "String_Node_Str"+ "String_Node_Str"+ this.inputPredicates.get(runName)+ "String_Node_Str"+ "String_Node_Str"+ this.algorithms.get(runName).getName()+ "String_Node_Str"+ "String_Node_Str"+ score+ "String_Node_Str"+ "String_Node_Str"+ weight+ "String_Node_Str"+ "String_Node_Str"+ (weight * score)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    }
    rdf.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    this.scoreData.loadRdfFromString(rdf.toString(),null,null);
  }
}