Program: 33321
Project: 33321
Buggy source:
protected void init(){
  Model dataset=ModelFactory.createDefaultModel();
  InputStream inputStream=getDataAsInputStream();
  if (inputStream == null) {
    return;
  }
  RDFDataMgr.read(dataset,inputStream,getDataLanguage());
  closeInputStream(inputStream);
  PrefixMapping prefixes=new PrefixMappingImpl().withDefaultMappings(PrefixMapping.Extended);
  prefixes.setNsPrefix("String_Node_Str","String_Node_Str");
  prefixes.setNsPrefix("String_Node_Str","String_Node_Str");
  prefixes.setNsPrefix("String_Node_Str","String_Node_Str");
  Query query=QueryFactory.create("String_Node_Str" + "String_Node_Str");
  QueryExecution exec=QueryExecutionFactory.create(query,dataset);
  ResultSet result=exec.execSelect();
  ParameterizedSparqlString annotationQuery=new ParameterizedSparqlString("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",prefixes);
  while (result.hasNext()) {
    QuerySolution solution=result.next();
    RDFNode rdfNode=solution.get("String_Node_Str");
    String context=rdfNode.asResource().toString();
    logger.debug("String_Node_Str",context);
    annotationQuery.clearParams();
    annotationQuery.setIri("String_Node_Str",context);
    QueryExecution qAnn=QueryExecutionFactory.create(annotationQuery.asQuery(),dataset);
    ResultSet annResult=qAnn.execSelect();
    texts.add(solution.get("String_Node_Str").asLiteral().getString());
    HashSet<Annotation> annotations=new HashSet<Annotation>();
    annotationsList.add(annotations);
    while (annResult.hasNext()) {
      QuerySolution annSolution=annResult.next();
      String page=annSolution.get("String_Node_Str").asResource().getURI();
      int id=DBpediaToWikiId.getId(page);
      int position=annSolution.get("String_Node_Str").asLiteral().getInt();
      int length=annSolution.get("String_Node_Str").asLiteral().getInt() - position;
      if (id != -1) {
        annotations.add(new Annotation(position,length,id));
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str",new Object[]{annSolution.get("String_Node_Str").asLiteral().getString(),position,length});
        }
      }
    }
  }
  logger.info("String_Node_Str",name);
  DBpediaToWikiId.write();
}

Fixed version (ground truth):
protected void init(){
  Model dataset=ModelFactory.createDefaultModel();
  InputStream inputStream=getDataAsInputStream();
  if (inputStream == null) {
    return;
  }
  RDFDataMgr.read(dataset,inputStream,getDataLanguage());
  closeInputStream(inputStream);
  PrefixMapping prefixes=new PrefixMappingImpl().withDefaultMappings(PrefixMapping.Extended);
  prefixes.setNsPrefix("String_Node_Str","String_Node_Str");
  prefixes.setNsPrefix("String_Node_Str","String_Node_Str");
  prefixes.setNsPrefix("String_Node_Str","String_Node_Str");
  Query query=QueryFactory.create("String_Node_Str" + "String_Node_Str");
  QueryExecution exec=QueryExecutionFactory.create(query,dataset);
  ResultSet result=exec.execSelect();
  ParameterizedSparqlString annotationQuery=new ParameterizedSparqlString("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",prefixes);
  int id, position, length;
  while (result.hasNext()) {
    QuerySolution solution=result.next();
    RDFNode rdfNode=solution.get("String_Node_Str");
    String context=rdfNode.asResource().toString();
    LOGGER.debug("String_Node_Str",context);
    annotationQuery.clearParams();
    annotationQuery.setIri("String_Node_Str",context);
    QueryExecution qAnn=QueryExecutionFactory.create(annotationQuery.asQuery(),dataset);
    ResultSet annResult=qAnn.execSelect();
    texts.add(solution.get("String_Node_Str").asLiteral().getString());
    HashSet<Annotation> annotations=new HashSet<Annotation>();
    annotationsList.add(annotations);
    while (annResult.hasNext()) {
      QuerySolution annSolution=annResult.next();
      String page=annSolution.get("String_Node_Str").asResource().getURI();
      try {
        id=wikiApi.getIdByTitle(dbpediaApi.dbpediaToWikipedia(extractTitle(page)));
      }
 catch (      IOException e) {
        LOGGER.warn("String_Node_Str" + page + "String_Node_Str");
        id=-1;
      }
      position=annSolution.get("String_Node_Str").asLiteral().getInt();
      length=annSolution.get("String_Node_Str").asLiteral().getInt() - position;
      if (id != -1) {
        annotations.add(new Annotation(position,length,id));
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("String_Node_Str",new Object[]{annSolution.get("String_Node_Str").asLiteral().getString(),position,length});
        }
      }
    }
  }
  LOGGER.info("String_Node_Str",name);
}