Program: 10138
Project: 10138
Buggy source:
/** 
 * Sends a SPARQL query using the Jena library. main format is JSON, use method getasjson
 */
public void send(){
  wasExecuted=true;
  ResultSet rs;
  String service=sparqlEndpoint.getURL().toString();
  writeToSparqlLog("String_Node_Str");
  SparqlQuery.writeToSparqlLog("String_Node_Str" + sparqlEndpoint.getHTTPRequest());
  writeToSparqlLog(sparqlQueryString);
  logger.trace("String_Node_Str");
  queryExecution=new QueryEngineHTTP(service,sparqlQueryString);
  for (  String dgu : sparqlEndpoint.getDefaultGraphURIs()) {
    queryExecution.addDefaultGraph(dgu);
  }
  for (  String ngu : sparqlEndpoint.getNamedGraphURIs()) {
    queryExecution.addNamedGraph(ngu);
  }
  HttpQuery.urlLimit=3 * 1024;
  Monitor httpTime=JamonMonitorLogger.getTimeMonitor(SparqlQuery.class,"String_Node_Str").start();
  try {
    logger.debug("String_Node_Str" + sparqlQueryString.length() + "String_Node_Str"+ sparqlEndpoint.getURL().toString());
    rs=queryExecution.execSelect();
    logger.trace("String_Node_Str");
    json=SparqlQuery.convertResultSetToJSON(ResultSetFactory.makeRewindable(rs));
    logger.trace(json);
  }
 catch (  HTTPException e) {
    logger.debug("String_Node_Str" + e.toString());
    logger.debug("String_Node_Str" + sparqlQueryString);
    writeToSparqlLog("String_Node_Str" + e.toString());
    isRunning=false;
    throw e;
  }
catch (  RuntimeException e) {
    logger.debug("String_Node_Str" + e.toString());
    logger.debug("String_Node_Str" + sparqlQueryString.substring(0,300).replaceAll("String_Node_Str","String_Node_Str"));
    writeToSparqlLog("String_Node_Str" + e.toString());
    isRunning=false;
    throw e;
  }
  httpTime.stop();
  isRunning=false;
}

Fixed version (ground truth):
/** 
 * Sends a SPARQL query using the Jena library. main format is JSON, use method getasjson
 */
public void send(){
  wasExecuted=true;
  ResultSet rs;
  String service=sparqlEndpoint.getURL().toString();
  writeToSparqlLog("String_Node_Str");
  SparqlQuery.writeToSparqlLog("String_Node_Str" + sparqlEndpoint.getHTTPRequest());
  writeToSparqlLog(sparqlQueryString);
  logger.trace("String_Node_Str");
  queryExecution=new QueryEngineHTTP(service,sparqlQueryString);
  for (  String dgu : sparqlEndpoint.getDefaultGraphURIs()) {
    queryExecution.addDefaultGraph(dgu);
  }
  for (  String ngu : sparqlEndpoint.getNamedGraphURIs()) {
    queryExecution.addNamedGraph(ngu);
  }
  HttpQuery.urlLimit=3 * 1024;
  Monitor httpTime=JamonMonitorLogger.getTimeMonitor(SparqlQuery.class,"String_Node_Str").start();
  try {
    logger.debug("String_Node_Str" + sparqlQueryString.length() + "String_Node_Str"+ sparqlEndpoint.getURL().toString());
    rs=queryExecution.execSelect();
    logger.trace("String_Node_Str");
    json=SparqlQuery.convertResultSetToJSON(ResultSetFactory.makeRewindable(rs));
    logger.trace(json);
  }
 catch (  HTTPException e) {
    logger.debug("String_Node_Str" + e.toString());
    logger.debug("String_Node_Str" + sparqlQueryString);
    writeToSparqlLog("String_Node_Str" + e.toString());
    isRunning=false;
    throw e;
  }
catch (  RuntimeException e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.toString());
      int length=Math.min(sparqlQueryString.length(),300);
      logger.debug("String_Node_Str" + sparqlQueryString.substring(0,length - 1).replaceAll("String_Node_Str","String_Node_Str"));
    }
    writeToSparqlLog("String_Node_Str" + e.toString());
    isRunning=false;
    throw e;
  }
  httpTime.stop();
  isRunning=false;
}