Program: 9418
Project: 9418
Buggy source:
public void run(){
  List<String> sparqlQueries=loadSPARQLQueries();
  logger.info("String_Node_Str" + sparqlQueries.size());
  int minNrOfExamples=3;
  int maxNrOfExamples=10;
  int stepSize=2;
  double[] noiseIntervals={0.0,0.2,0.4};
  for (int nrOfExamples=minNrOfExamples; nrOfExamples < maxNrOfExamples; nrOfExamples=Math.min(nrOfExamples + stepSize,maxNrOfExamples)) {
    for (int i=0; i < noiseIntervals.length; i++) {
      double noise=noiseIntervals[i];
      FileAppender appender=null;
      try {
        appender=new FileAppender(new SimpleLayout(),"String_Node_Str" + nrOfExamples + "String_Node_Str"+ noise+ "String_Node_Str",false);
        Logger.getRootLogger().addAppender(appender);
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
      logger.info("String_Node_Str" + nrOfExamples + "String_Node_Str"+ noise);
      DescriptiveStatistics bestReturnedSolutionPrecisionStats=new DescriptiveStatistics();
      DescriptiveStatistics bestReturnedSolutionRecallStats=new DescriptiveStatistics();
      DescriptiveStatistics bestReturnedSolutionFMeasureStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionPrecisionStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionRecallStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionFMeasureStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionPositionStats=new DescriptiveStatistics();
      for (      String sparqlQuery : sparqlQueries) {
        if (!sparqlQuery.contains("String_Node_Str"))         continue;
        logger.info("String_Node_Str");
        logger.info("String_Node_Str" + sparqlQuery);
        int possibleNrOfExamples=Math.min(getResultCount(sparqlQuery),nrOfExamples);
        try {
          Map<OWLIndividual,QueryTree<String>> generatedExamples=generateExamples(sparqlQuery,possibleNrOfExamples,noise);
          PosNegLPStandard lp=new PosNegLPStandard();
          lp.setPositiveExamples(generatedExamples.keySet());
          QTL2Disjunctive la=new QTL2Disjunctive(lp,qef);
          la.setAllowedNamespaces(allowedNamespaces);
          la.setIgnoredPropperties(ignoredProperties);
          la.setTreeFactory(queryTreeFactory);
          la.setPositiveExampleTrees(generatedExamples);
          la.init();
          la.start();
          List<EvaluatedQueryTree<String>> solutions=new ArrayList<EvaluatedQueryTree<String>>(la.getSolutions());
          EvaluatedQueryTree<String> bestSolution=solutions.get(0);
          logger.info("String_Node_Str" + solutions.size() + "String_Node_Str");
          logger.info("String_Node_Str" + bestSolution.asEvaluatedDescription());
          logger.info("String_Node_Str" + bestSolution.getTreeScore());
          String learnedSPARQLQuery=bestSolution.getTree().toSPARQLQueryString(true,false);
          double precision=precision(sparqlQuery,learnedSPARQLQuery);
          bestReturnedSolutionPrecisionStats.addValue(precision);
          double recall=recall(sparqlQuery,learnedSPARQLQuery);
          bestReturnedSolutionRecallStats.addValue(recall);
          double fmeasure=fMeasure(sparqlQuery,learnedSPARQLQuery);
          bestReturnedSolutionFMeasureStats.addValue(fmeasure);
          logger.info(String.format("String_Node_Str",precision,recall,fmeasure));
          EvaluatedQueryTree<String> bestMatchingTree=findBestMatchingTree(solutions,sparqlQuery);
          int position=solutions.indexOf(bestMatchingTree);
          bestSolutionPositionStats.addValue(position);
          if (position > 0) {
            logger.info("String_Node_Str" + position);
            logger.info("String_Node_Str" + bestMatchingTree.asEvaluatedDescription());
            logger.info("String_Node_Str" + bestMatchingTree.getTreeScore());
            String bestLearnedSPARQLQuery=bestMatchingTree.getTree().toSPARQLQueryString(true,false);
            precision=precision(sparqlQuery,bestLearnedSPARQLQuery);
            recall=recall(sparqlQuery,bestLearnedSPARQLQuery);
            fmeasure=fMeasure(sparqlQuery,bestLearnedSPARQLQuery);
            logger.info(String.format("String_Node_Str",precision,recall,fmeasure));
          }
 else {
            logger.info("String_Node_Str");
          }
          bestSolutionRecallStats.addValue(recall);
          bestSolutionPrecisionStats.addValue(precision);
          bestSolutionFMeasureStats.addValue(fmeasure);
        }
 catch (        Exception e) {
          logger.error("String_Node_Str",e);
          System.exit(0);
        }
      }
      Logger.getRootLogger().removeAppender(appender);
      String result="String_Node_Str";
      result+="String_Node_Str" + bestReturnedSolutionPrecisionStats;
      result+="String_Node_Str" + bestReturnedSolutionRecallStats;
      result+="String_Node_Str" + bestReturnedSolutionFMeasureStats;
      result+="String_Node_Str" + Arrays.toString(bestSolutionPositionStats.getValues());
      result+="String_Node_Str" + bestSolutionPositionStats;
      result+="String_Node_Str" + bestSolutionPrecisionStats;
      result+="String_Node_Str" + bestSolutionRecallStats;
      result+="String_Node_Str" + bestSolutionFMeasureStats;
      logger.info(result);
      try {
        Files.write(result,new File("String_Node_Str" + nrOfExamples + "String_Node_Str"+ noise+ "String_Node_Str"),Charsets.UTF_8);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  List<String> sparqlQueries=loadSPARQLQueries();
  logger.info("String_Node_Str" + sparqlQueries.size());
  int minNrOfExamples=3;
  int maxNrOfExamples=10;
  int stepSize=2;
  double[] noiseIntervals={0.0,0.2,0.4};
  for (int nrOfExamples=minNrOfExamples; nrOfExamples < maxNrOfExamples; nrOfExamples=Math.min(nrOfExamples + stepSize,maxNrOfExamples)) {
    for (int i=0; i < noiseIntervals.length; i++) {
      double noise=noiseIntervals[i];
      FileAppender appender=null;
      try {
        appender=new FileAppender(new SimpleLayout(),"String_Node_Str" + nrOfExamples + "String_Node_Str"+ noise+ "String_Node_Str",false);
        Logger.getRootLogger().addAppender(appender);
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
      logger.info("String_Node_Str" + nrOfExamples + "String_Node_Str"+ noise);
      DescriptiveStatistics bestReturnedSolutionPrecisionStats=new DescriptiveStatistics();
      DescriptiveStatistics bestReturnedSolutionRecallStats=new DescriptiveStatistics();
      DescriptiveStatistics bestReturnedSolutionFMeasureStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionPrecisionStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionRecallStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionFMeasureStats=new DescriptiveStatistics();
      DescriptiveStatistics bestSolutionPositionStats=new DescriptiveStatistics();
      for (      String sparqlQuery : sparqlQueries) {
        logger.info("String_Node_Str");
        logger.info("String_Node_Str" + sparqlQuery);
        int possibleNrOfExamples=Math.min(getResultCount(sparqlQuery),nrOfExamples);
        try {
          Map<OWLIndividual,QueryTree<String>> generatedExamples=generateExamples(sparqlQuery,possibleNrOfExamples,noise);
          PosNegLPStandard lp=new PosNegLPStandard();
          lp.setPositiveExamples(generatedExamples.keySet());
          QTL2Disjunctive la=new QTL2Disjunctive(lp,qef);
          la.setAllowedNamespaces(allowedNamespaces);
          la.setIgnoredPropperties(ignoredProperties);
          la.setTreeFactory(queryTreeFactory);
          la.setPositiveExampleTrees(generatedExamples);
          la.init();
          la.start();
          List<EvaluatedQueryTree<String>> solutions=new ArrayList<EvaluatedQueryTree<String>>(la.getSolutions());
          EvaluatedQueryTree<String> bestSolution=solutions.get(0);
          logger.info("String_Node_Str" + solutions.size() + "String_Node_Str");
          logger.info("String_Node_Str" + bestSolution.asEvaluatedDescription());
          logger.info("String_Node_Str" + bestSolution.getTreeScore());
          String learnedSPARQLQuery=bestSolution.getTree().toSPARQLQueryString(true,false);
          double precision=precision(sparqlQuery,learnedSPARQLQuery);
          bestReturnedSolutionPrecisionStats.addValue(precision);
          double recall=recall(sparqlQuery,learnedSPARQLQuery);
          bestReturnedSolutionRecallStats.addValue(recall);
          double fmeasure=fMeasure(sparqlQuery,learnedSPARQLQuery);
          bestReturnedSolutionFMeasureStats.addValue(fmeasure);
          logger.info(String.format("String_Node_Str",precision,recall,fmeasure));
          EvaluatedQueryTree<String> bestMatchingTree=findBestMatchingTree(solutions,sparqlQuery);
          int position=solutions.indexOf(bestMatchingTree);
          bestSolutionPositionStats.addValue(position);
          if (position > 0) {
            logger.info("String_Node_Str" + position);
            logger.info("String_Node_Str" + bestMatchingTree.asEvaluatedDescription());
            logger.info("String_Node_Str" + bestMatchingTree.getTreeScore());
            String bestLearnedSPARQLQuery=bestMatchingTree.getTree().toSPARQLQueryString(true,false);
            precision=precision(sparqlQuery,bestLearnedSPARQLQuery);
            recall=recall(sparqlQuery,bestLearnedSPARQLQuery);
            fmeasure=fMeasure(sparqlQuery,bestLearnedSPARQLQuery);
            logger.info(String.format("String_Node_Str",precision,recall,fmeasure));
          }
 else {
            logger.info("String_Node_Str");
          }
          bestSolutionRecallStats.addValue(recall);
          bestSolutionPrecisionStats.addValue(precision);
          bestSolutionFMeasureStats.addValue(fmeasure);
        }
 catch (        Exception e) {
          logger.error("String_Node_Str",e);
          System.exit(0);
        }
      }
      Logger.getRootLogger().removeAppender(appender);
      String result="String_Node_Str";
      result+="String_Node_Str" + bestReturnedSolutionPrecisionStats;
      result+="String_Node_Str" + bestReturnedSolutionRecallStats;
      result+="String_Node_Str" + bestReturnedSolutionFMeasureStats;
      result+="String_Node_Str" + Arrays.toString(bestSolutionPositionStats.getValues());
      result+="String_Node_Str" + bestSolutionPositionStats;
      result+="String_Node_Str" + bestSolutionPrecisionStats;
      result+="String_Node_Str" + bestSolutionRecallStats;
      result+="String_Node_Str" + bestSolutionFMeasureStats;
      logger.info(result);
      try {
        Files.write(result,new File("String_Node_Str" + nrOfExamples + "String_Node_Str"+ noise+ "String_Node_Str"),Charsets.UTF_8);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}