Program: 9724
Project: 9724
Buggy source:
public void fillCache(int limit){
  monitor.reset();
  monitor.start();
  logger.info("String_Node_Str");
  Model model;
  com.hp.hpl.jena.rdf.model.Statement st;
  String objectURI;
  String modelStr;
  int i=0;
  logger.info("String_Node_Str" + i * CHUNK_SIZE + "String_Node_Str" + i * CHUNK_SIZE + CHUNK_SIZE);
  List<String> resources=getResources(CHUNK_SIZE,i * CHUNK_SIZE);
  logger.info("String_Node_Str" + resources);
  while (!resources.isEmpty()) {
    for (    String resource : resources) {
      logger.info("String_Node_Str" + resource);
      queryMonitor.start();
      model=createModel(resource);
      queryMonitor.stop();
      logger.info("String_Node_Str" + model.size() + "String_Node_Str"+ queryMonitor.getLastValue() / 1000 + "String_Node_Str");
      modelStr=convertModel2String(model);
      logger.info("String_Node_Str");
      dbMonitor.start();
      writeTriples2DB(resource,modelStr);
      int id=getResourceID(resource);
      if (id != -1) {
        for (StmtIterator iter=model.listStatements(); iter.hasNext(); ) {
          st=iter.next();
          if (st.getObject().isURIResource()) {
            objectURI=st.getObject().asResource().getURI();
            if (objectURI.startsWith("String_Node_Str")) {
              logger.info("String_Node_Str" + resource + "String_Node_Str"+ objectURI);
              logger.info("String_Node_Str" + resource + "String_Node_Str"+ id);
              writeKey2KeyIntoDB(id,objectURI);
            }
          }
        }
      }
 else {
        logger.info("String_Node_Str" + resource);
      }
      dbMonitor.stop();
    }
    i++;
    if (limit != -1 && i * CHUNK_SIZE >= limit) {
      break;
    }
    logger.info("String_Node_Str" + i * CHUNK_SIZE + "String_Node_Str" + i * CHUNK_SIZE + CHUNK_SIZE);
    resources=getResources(CHUNK_SIZE,i * CHUNK_SIZE);
    logger.info("String_Node_Str" + resources);
  }
  monitor.stop();
  logger.info("String_Node_Str" + queryMonitor.getTotal() / 1000 + "String_Node_Str");
  logger.info("String_Node_Str" + dbMonitor.getTotal() / 1000 + "String_Node_Str");
  logger.info("String_Node_Str" + monitor.getTotal() / 1000 + "String_Node_Str");
  try {
    conn.close();
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void fillCache(int limit){
  monitor.reset();
  monitor.start();
  logger.info("String_Node_Str");
  Model model;
  com.hp.hpl.jena.rdf.model.Statement st;
  String objectURI;
  String modelStr;
  int i=0;
  logger.info("String_Node_Str" + i * CHUNK_SIZE + "String_Node_Str" + i * CHUNK_SIZE + CHUNK_SIZE);
  List<String> resources=getResources(CHUNK_SIZE,i * CHUNK_SIZE);
  logger.info("String_Node_Str" + resources);
  while (!resources.isEmpty()) {
    for (    String resource : resources) {
      logger.info("String_Node_Str" + resource);
      queryMonitor.start();
      model=createModel(resource);
      queryMonitor.stop();
      logger.info("String_Node_Str" + model.size() + "String_Node_Str"+ queryMonitor.getLastValue() / 1000 + "String_Node_Str");
      modelStr=convertModel2String(model);
      logger.info("String_Node_Str");
      dbMonitor.start();
      writeTriples2DB(resource,modelStr);
      int id=getResourceID(resource);
      writeKey2KeyIntoDB(id,id);
      if (id != -1) {
        for (StmtIterator iter=model.listStatements(); iter.hasNext(); ) {
          st=iter.next();
          if (st.getObject().isURIResource()) {
            objectURI=st.getObject().asResource().getURI();
            if (objectURI.startsWith("String_Node_Str")) {
              logger.info("String_Node_Str" + resource + "String_Node_Str"+ objectURI);
              logger.info("String_Node_Str" + resource + "String_Node_Str"+ id);
              writeKey2KeyIntoDB(id,objectURI);
            }
          }
        }
      }
 else {
        logger.info("String_Node_Str" + resource);
      }
      dbMonitor.stop();
    }
    i++;
    if (limit != -1 && i * CHUNK_SIZE >= limit) {
      break;
    }
    logger.info("String_Node_Str" + i * CHUNK_SIZE + "String_Node_Str" + i * CHUNK_SIZE + CHUNK_SIZE);
    resources=getResources(CHUNK_SIZE,i * CHUNK_SIZE);
    logger.info("String_Node_Str" + resources);
  }
  monitor.stop();
  logger.info("String_Node_Str" + queryMonitor.getTotal() / 1000 + "String_Node_Str");
  logger.info("String_Node_Str" + dbMonitor.getTotal() / 1000 + "String_Node_Str");
  logger.info("String_Node_Str" + monitor.getTotal() / 1000 + "String_Node_Str");
  try {
    conn.close();
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
}