Program: 9690
Project: 9690
Buggy source:
public void evaluate(){
  String targetQuery;
  Set<String> answers;
  List<String> examples;
  Set<String> relatedResources;
  List<String> relevantWords;
  int i=1;
  int learnedQueries=0;
  for (  String question : question2Answers.keySet()) {
    logger.debug(getNewQuestionString(i++,question));
    miniLogger.info("String_Node_Str" + question);
    try {
      targetQuery=question2query.get(question);
      logger.debug("String_Node_Str" + targetQuery);
      miniLogger.info("String_Node_Str" + targetQuery);
      answers=getResourcesBySPARQLQuery(targetQuery,"String_Node_Str");
      logger.debug("String_Node_Str" + answers.size() + "String_Node_Str"+ answers);
      miniLogger.info("String_Node_Str" + answers.size() + "String_Node_Str"+ answers);
      relevantWords=getRelevantWords(question);
      QuestionBasedStatementFilter filter=new QuestionBasedStatementFilter(new HashSet<String>(relevantWords));
      filter.setThreshold(SIMILARITY_THRESHOLD);
      exFinder.setStatementFilter(filter);
      if (USE_SYNONYMS) {
        relevantWords.addAll(getSynonyms(relevantWords));
        logger.debug("String_Node_Str" + relevantWords);
      }
      question="String_Node_Str";
      for (      String word : relevantWords) {
        question+="String_Node_Str" + word;
      }
      question.trim();
      logger.debug("String_Node_Str" + question);
      if (USE_WIKIPEDIA_SEARCH) {
        examples=getResourcesByWikipedia(question);
      }
 else {
        examples=getResourcesByNLQueryWithLucene(question);
      }
      List<String> posExamples=new ArrayList<String>();
      List<String> negExamples=new ArrayList<String>();
      for (      String ex : examples) {
        if (answers.contains(ex)) {
          if (posExamples.size() < NR_OF_POS_START_EXAMPLES_COUNT) {
            miniLogger.info("String_Node_Str" + ex + "String_Node_Str");
            posExamples.add(ex);
          }
        }
 else {
          if (negExamples.size() < NR_OF_NEG_START_EXAMPLES_COUNT) {
            miniLogger.info("String_Node_Str" + ex + "String_Node_Str");
            negExamples.add(ex);
          }
        }
      }
      miniLogger.info("String_Node_Str" + posExamples);
      if (posExamples.size() < NR_OF_POS_START_EXAMPLES_COUNT) {
        logger.debug("String_Node_Str" + posExamples.size() + "String_Node_Str");
        for (        String answer : answers) {
          posExamples.add(answer);
          if (posExamples.size() == NR_OF_POS_START_EXAMPLES_COUNT) {
            break;
          }
        }
      }
      if (posExamples.isEmpty()) {
        logger.warn("String_Node_Str" + TOP_K + "String_Node_Str"+ "String_Node_Str");
        continue;
      }
      logger.info("String_Node_Str" + posExamples.size() + "String_Node_Str"+ posExamples);
      logger.info("String_Node_Str" + negExamples.size() + "String_Node_Str"+ negExamples);
      Set<String> learnedResources;
      String oldLearnedQuery="String_Node_Str";
      boolean learningFailed=false;
      do {
        logger.info("String_Node_Str");
        long startTime=System.currentTimeMillis();
        String example=exFinder.findSimilarExample(posExamples,negExamples).getURI();
        logger.debug("String_Node_Str" + example + "String_Node_Str"+ (System.currentTimeMillis() - startTime)+ "String_Node_Str");
        miniLogger.info("String_Node_Str" + example + "String_Node_Str");
        String learnedQuery=exFinder.getCurrentQuery();
        if (oldLearnedQuery.equals(learnedQuery)) {
          learningFailed=true;
          logger.info("String_Node_Str");
          break;
        }
        oldLearnedQuery=learnedQuery;
        logger.debug("String_Node_Str" + learnedQuery);
        learnedQuery="String_Node_Str" + learnedQuery.substring(7);
        learnedResources=getResourcesBySPARQLQuery(learnedQuery,"String_Node_Str");
        logger.debug("String_Node_Str" + learnedResources.size());
        if (answers.contains(example)) {
          posExamples.add(example);
          miniLogger.info("String_Node_Str");
        }
 else {
          negExamples.add(example);
          miniLogger.info("String_Node_Str");
        }
        miniLogger.info("String_Node_Str" + learnedQuery);
      }
 while (!answers.equals(learnedResources));
      if (!learningFailed) {
        logger.info("String_Node_Str" + question + "String_Node_Str");
        miniLogger.info("String_Node_Str");
        learnedQueries++;
      }
 else {
        miniLogger.info("String_Node_Str");
      }
    }
 catch (    TimeOutException e) {
      e.printStackTrace();
    }
catch (    SPARQLQueryException e) {
      e.printStackTrace();
    }
catch (    Exception e) {
      logger.error("String_Node_Str",e);
      miniLogger.info("String_Node_Str");
    }
  }
  logger.info("String_Node_Str" + learnedQueries + "String_Node_Str"+ question2query.keySet().size()+ "String_Node_Str");
}

Fixed version (ground truth):
public void evaluate(){
  String targetQuery;
  Set<String> answers;
  List<String> examples;
  Set<String> relatedResources;
  List<String> relevantWords;
  int i=1;
  int learnedQueries=0;
  for (  String question : question2Answers.keySet()) {
    logger.debug(getNewQuestionString(i++,question));
    try {
      targetQuery=question2query.get(question);
      logger.debug("String_Node_Str" + targetQuery);
      answers=getResourcesBySPARQLQuery(targetQuery,"String_Node_Str");
      logger.debug("String_Node_Str" + answers.size() + "String_Node_Str"+ answers);
      printStartingPosition(i,question,targetQuery,answers);
      relevantWords=getRelevantWords(question);
      QuestionBasedStatementFilter filter=new QuestionBasedStatementFilter(new HashSet<String>(relevantWords));
      filter.setThreshold(SIMILARITY_THRESHOLD);
      exFinder.setStatementFilter(filter);
      if (USE_SYNONYMS) {
        relevantWords.addAll(getSynonyms(relevantWords));
        logger.debug("String_Node_Str" + relevantWords);
      }
      question="String_Node_Str";
      for (      String word : relevantWords) {
        question+="String_Node_Str" + word;
      }
      question.trim();
      logger.debug("String_Node_Str" + question);
      if (USE_WIKIPEDIA_SEARCH) {
        examples=getResourcesByWikipedia(question);
      }
 else {
        examples=getResourcesByNLQueryWithLucene(question);
      }
      miniLogger.info("String_Node_Str" + examples);
      List<String> posExamples=new ArrayList<String>();
      List<String> negExamples=new ArrayList<String>();
      for (      String ex : examples) {
        if (answers.contains(ex)) {
          if (posExamples.size() < NR_OF_POS_START_EXAMPLES_COUNT) {
            miniLogger.info("String_Node_Str" + ex + "String_Node_Str");
            posExamples.add(ex);
          }
        }
 else {
          if (negExamples.size() < NR_OF_NEG_START_EXAMPLES_COUNT) {
            negExamples.add(ex);
          }
        }
      }
      if (posExamples.size() < NR_OF_POS_START_EXAMPLES_COUNT) {
        logger.debug("String_Node_Str" + posExamples.size() + "String_Node_Str");
        miniLogger.info("String_Node_Str" + (NR_OF_POS_START_EXAMPLES_COUNT - posExamples.size()) + "String_Node_Str");
        for (        String answer : answers) {
          if (posExamples.add(answer)) {
            miniLogger.info("String_Node_Str" + answer + "String_Node_Str");
          }
          if (posExamples.size() == NR_OF_POS_START_EXAMPLES_COUNT) {
            break;
          }
        }
      }
      if (posExamples.isEmpty()) {
        logger.warn("String_Node_Str" + TOP_K + "String_Node_Str"+ "String_Node_Str");
        continue;
      }
      logger.info("String_Node_Str" + posExamples.size() + "String_Node_Str"+ posExamples);
      logger.info("String_Node_Str" + negExamples.size() + "String_Node_Str"+ negExamples);
      miniLogger.info("String_Node_Str");
      if (LGGIsSolution(posExamples,answers)) {
        logger.info("String_Node_Str");
        miniLogger.info("String_Node_Str");
        continue;
      }
      Set<String> learnedResources;
      String oldLearnedQuery="String_Node_Str";
      boolean learningFailed=false;
      do {
        logger.info("String_Node_Str");
        long startTime=System.currentTimeMillis();
        String example=exFinder.findSimilarExample(posExamples,negExamples).getURI();
        logger.debug("String_Node_Str" + example + "String_Node_Str"+ (System.currentTimeMillis() - startTime)+ "String_Node_Str");
        miniLogger.info("String_Node_Str" + example + "String_Node_Str");
        String learnedQuery=exFinder.getCurrentQuery();
        if (oldLearnedQuery.equals(learnedQuery)) {
          learningFailed=true;
          logger.info("String_Node_Str");
          break;
        }
        oldLearnedQuery=learnedQuery;
        logger.debug("String_Node_Str" + learnedQuery);
        learnedQuery="String_Node_Str" + learnedQuery.substring(7);
        learnedResources=getResourcesBySPARQLQuery(learnedQuery,"String_Node_Str");
        logger.debug("String_Node_Str" + learnedResources.size());
        if (answers.contains(example)) {
          posExamples.add(example);
          miniLogger.info("String_Node_Str");
        }
 else {
          negExamples.add(example);
          miniLogger.info("String_Node_Str");
        }
        miniLogger.info("String_Node_Str" + learnedQuery);
      }
 while (!answers.equals(learnedResources));
      if (!learningFailed) {
        logger.info("String_Node_Str" + question + "String_Node_Str");
        miniLogger.info("String_Node_Str");
        learnedQueries++;
      }
 else {
        miniLogger.info("String_Node_Str");
      }
    }
 catch (    TimeOutException e) {
      e.printStackTrace();
    }
catch (    SPARQLQueryException e) {
      e.printStackTrace();
    }
catch (    Exception e) {
      logger.error("String_Node_Str",e);
      miniLogger.info("String_Node_Str");
    }
  }
  logger.info("String_Node_Str" + learnedQueries + "String_Node_Str"+ question2query.keySet().size()+ "String_Node_Str");
}