Program: 9905
Project: 9905
Buggy source:
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws ComponentInitException, LearningProblemUnsupportedException, IOException {
  Logger.getRootLogger().setLevel(Level.WARN);
  if (args.length == 0) {
    System.out.println("String_Node_Str");
    System.exit(0);
  }
  ComponentManager cm=ComponentManager.getInstance();
  OWLFile ks=cm.knowledgeSource(OWLFile.class);
  if (args[0].startsWith("String_Node_Str")) {
    ks.getConfigurator().setUrl(new URL(args[0]));
  }
 else {
    File owlFile=new File(args[0]);
    ks.getConfigurator().setUrl(owlFile.toURI().toURL());
  }
  ks.init();
  ReasonerComponent reasoner=null;
  if (useFastInstanceChecker) {
    reasoner=cm.reasoner(FastInstanceChecker.class,ks);
  }
 else {
    reasoner=cm.reasoner(OWLAPIReasoner.class,ks);
  }
  reasoner.init();
  System.out.println("String_Node_Str" + args[0] + "String_Node_Str");
  String baseURI=reasoner.getBaseURI();
  Map<String,String> prefixes=reasoner.getPrefixes();
  String userInputProtocol="String_Node_Str";
  int classCandidatesCount=0;
  Stat instanceCountStat=new Stat();
  Stat classExpressionTestsStat=new Stat();
  Stat approxDiffStat=new Stat();
  int candidatesAboveThresholdCount=0;
  int missesCount=0;
  int foundDescriptionCount=0;
  int noSensibleDescriptionCount=0;
  int inconsistencyDetected=0;
  int moreInstancesCount=0;
  int nonPerfectCount=0;
  Stat moreInstancesCountStat=new Stat();
  Stat accStat=new Stat();
  Stat accSelectedStat=new Stat();
  Stat accAboveThresholdStat=new Stat();
  Stat positionStat=new Stat();
  int candidatesAboveThresholdCountSC=0;
  int missesCountSC=0;
  int foundDescriptionCountSC=0;
  int noSensibleDescriptionCountSC=0;
  int inconsistencyDetectedSC=0;
  int moreInstancesCountSC=0;
  int nonPerfectCountSC=0;
  Stat moreInstancesCountStatSC=new Stat();
  Stat accStatSC=new Stat();
  Stat accSelectedStatSC=new Stat();
  Stat accAboveThresholdStatSC=new Stat();
  Stat positionStatSC=new Stat();
  Set<NamedClass> classes=new TreeSet<NamedClass>(reasoner.getNamedClasses());
  classes.remove(new NamedClass("String_Node_Str"));
  for (  NamedClass nc : classes) {
    int instanceCount=reasoner.getIndividuals(nc).size();
    if (instanceCount < minInstanceCount) {
      System.out.println("String_Node_Str" + nc.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str"+ instanceCount+ "String_Node_Str"+ minInstanceCount+ "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + nc.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str"+ instanceCount+ "String_Node_Str");
      classCandidatesCount++;
      instanceCountStat.addNumber(instanceCount);
      TreeSet<EvaluatedDescriptionClass> suggestions;
      for (int i=0; i <= 1; i++) {
        ClassLearningProblem lp=cm.learningProblem(ClassLearningProblem.class,reasoner);
        lp.getConfigurator().setClassToDescribe(nc.getURI().toURL());
        if (i == 0) {
          System.out.println("String_Node_Str" + algorithmRuntimeInSeconds + "String_Node_Str");
          lp.getConfigurator().setType("String_Node_Str");
        }
 else {
          System.out.println("String_Node_Str" + algorithmRuntimeInSeconds + "String_Node_Str");
          lp.getConfigurator().setType("String_Node_Str");
        }
        lp.getConfigurator().setUseApproximations(useApproximations);
        lp.init();
        CELOE celoe=cm.learningAlgorithm(CELOE.class,lp,reasoner);
        CELOEConfigurator cf=celoe.getConfigurator();
        cf.setUseNegation(false);
        cf.setValueFrequencyThreshold(3);
        cf.setMaxExecutionTimeInSeconds(algorithmRuntimeInSeconds);
        cf.setNoisePercentage(noisePercent);
        cf.setMaxNrOfResults(10);
        celoe.init();
        celoe.start();
        classExpressionTestsStat.addNumber(celoe.getClassExpressionTests());
        EvaluatedDescription best=celoe.getCurrentlyBestEvaluatedDescription();
        double bestAcc=best.getAccuracy();
        if (i == 0) {
          accStat.addNumber(bestAcc);
        }
 else {
          accStatSC.addNumber(bestAcc);
        }
        if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) {
          System.out.println("String_Node_Str" + (100 * minAccuracy) + "String_Node_Str"+ best.getDescription().toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str"+ df.format(bestAcc)+ "String_Node_Str");
        }
 else {
          if (i == 0) {
            accAboveThresholdStat.addNumber(bestAcc);
            candidatesAboveThresholdCount++;
          }
 else {
            accAboveThresholdStatSC.addNumber(bestAcc);
            candidatesAboveThresholdCountSC++;
          }
          suggestions=(TreeSet<EvaluatedDescriptionClass>)celoe.getCurrentlyBestEvaluatedDescriptions();
          List<EvaluatedDescriptionClass> suggestionsList=new LinkedList<EvaluatedDescriptionClass>(suggestions.descendingSet());
          if (computeApproxDiff) {
            for (            EvaluatedDescription ed : suggestionsList) {
              Description d=ed.getDescription();
              double approx=lp.getAccuracyOrTooWeakApprox(d,noisePercent / (double)100);
              double exact=lp.getAccuracyOrTooWeakExact(d,noisePercent / (double)100);
              double diff=Math.abs(approx - exact);
              approxDiffStat.addNumber(diff);
            }
          }
          int nr=0;
          for (          EvaluatedDescription suggestion : suggestionsList) {
            System.out.println(nr + "String_Node_Str" + suggestion.getDescription().toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str"+ df.format(suggestion.getAccuracy())+ "String_Node_Str");
            nr++;
          }
          System.out.println("String_Node_Str" + (suggestions.size() - 1) + "String_Node_Str");
          String[] inputs=new String[suggestions.size() + 2];
          inputs[0]="String_Node_Str";
          inputs[1]="String_Node_Str";
          for (int j=0; j < suggestions.size(); j++) {
            inputs[j + 2]="String_Node_Str" + j;
          }
          List<String> allowedInputs=Arrays.asList(inputs);
          String input;
          if (autoMode) {
            input="String_Node_Str";
          }
 else {
            do {
              BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
              input=br.readLine();
            }
 while (!allowedInputs.contains(input));
          }
          userInputProtocol+=input;
          if (input.equals("String_Node_Str")) {
            if (i == 0) {
              missesCount++;
            }
 else {
              missesCountSC++;
            }
            System.out.println("String_Node_Str");
          }
 else           if (input.equals("String_Node_Str")) {
            if (i == 0) {
              noSensibleDescriptionCount++;
            }
 else {
              noSensibleDescriptionCountSC++;
            }
            System.out.println("String_Node_Str");
          }
 else {
            int selectedNr=Integer.parseInt(input);
            EvaluatedDescriptionClass selectedExpression=suggestionsList.get(selectedNr);
            System.out.println("String_Node_Str" + selectedExpression.getDescription().toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str");
            boolean isConsistent=selectedExpression.isConsistent();
            if (!isConsistent) {
              System.out.println("String_Node_Str");
            }
            Set<Individual> addInst=selectedExpression.getAdditionalInstances();
            int additionalInstances=addInst.size();
            if (additionalInstances > 0) {
              System.out.println("String_Node_Str" + additionalInstances + "String_Node_Str"+ addInst.iterator().next().toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str");
            }
            if (i == 0) {
              accSelectedStat.addNumber(bestAcc);
              positionStat.addNumber(selectedNr);
              foundDescriptionCount++;
              if (!isConsistent) {
                inconsistencyDetected++;
              }
              if (additionalInstances > 0) {
                moreInstancesCount++;
                moreInstancesCountStat.addNumber(additionalInstances);
              }
              if (bestAcc < 0.9999) {
                nonPerfectCount++;
              }
            }
 else {
              accSelectedStatSC.addNumber(bestAcc);
              positionStatSC.addNumber(selectedNr);
              foundDescriptionCountSC++;
              if (!isConsistent) {
                inconsistencyDetectedSC++;
              }
              if (additionalInstances > 0) {
                moreInstancesCountSC++;
                moreInstancesCountStatSC.addNumber(additionalInstances);
              }
              if (bestAcc < 0.9999) {
                nonPerfectCountSC++;
              }
            }
          }
        }
        cm.freeComponent(celoe);
        cm.freeComponent(lp);
      }
    }
  }
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println();
  System.out.println("String_Node_Str" + args[0]);
  System.out.println("String_Node_Str" + minAccuracy + "String_Node_Str"+ minInstanceCount+ "String_Node_Str"+ algorithmRuntimeInSeconds+ "String_Node_Str");
  System.out.println("String_Node_Str" + userInputProtocol);
  System.out.println("String_Node_Str" + classes.size());
  System.out.println("String_Node_Str" + minInstanceCount + "String_Node_Str"+ classCandidatesCount);
  System.out.println("String_Node_Str" + classExpressionTestsStat.prettyPrint("String_Node_Str"));
  if (computeApproxDiff) {
    System.out.println("String_Node_Str" + approxDiffStat.prettyPrint());
  }
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + (minAccuracy * 100) + "String_Node_Str"+ candidatesAboveThresholdCount);
  System.out.println("String_Node_Str" + foundDescriptionCount);
  System.out.println("String_Node_Str" + missesCount);
  System.out.println("String_Node_Str" + noSensibleDescriptionCount);
  System.out.println("String_Node_Str" + inconsistencyDetected);
  System.out.println("String_Node_Str" + moreInstancesCountStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accSelectedStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accAboveThresholdStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + nonPerfectCount);
  System.out.println("String_Node_Str" + positionStat.prettyPrint("String_Node_Str"));
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + (minAccuracy * 100) + "String_Node_Str"+ candidatesAboveThresholdCountSC);
  System.out.println("String_Node_Str" + foundDescriptionCountSC);
  System.out.println("String_Node_Str" + missesCountSC);
  System.out.println("String_Node_Str" + noSensibleDescriptionCountSC);
  System.out.println("String_Node_Str" + inconsistencyDetectedSC);
  System.out.println("String_Node_Str" + moreInstancesCountStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accSelectedStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accAboveThresholdStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + nonPerfectCountSC);
  System.out.println("String_Node_Str" + positionStatSC.prettyPrint("String_Node_Str"));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws ComponentInitException, LearningProblemUnsupportedException, IOException {
  Logger.getRootLogger().setLevel(Level.WARN);
  if (args.length == 0) {
    System.out.println("String_Node_Str");
    System.exit(0);
  }
  ComponentManager cm=ComponentManager.getInstance();
  OWLFile ks=cm.knowledgeSource(OWLFile.class);
  if (args[0].startsWith("String_Node_Str")) {
    ks.getConfigurator().setUrl(new URL(args[0]));
  }
 else {
    File owlFile=new File(args[0]);
    ks.getConfigurator().setUrl(owlFile.toURI().toURL());
  }
  ks.init();
  ReasonerComponent reasoner=null;
  if (useFastInstanceChecker) {
    reasoner=cm.reasoner(FastInstanceChecker.class,ks);
  }
 else {
    reasoner=cm.reasoner(OWLAPIReasoner.class,ks);
  }
  reasoner.init();
  System.out.println("String_Node_Str" + args[0] + "String_Node_Str");
  String baseURI=reasoner.getBaseURI();
  Map<String,String> prefixes=reasoner.getPrefixes();
  String userInputProtocol="String_Node_Str";
  int classCandidatesCount=0;
  Stat instanceCountStat=new Stat();
  Stat classExpressionTestsStat=new Stat();
  Stat approxDiffStat=new Stat();
  int candidatesAboveThresholdCount=0;
  int missesCount=0;
  int foundDescriptionCount=0;
  int noSensibleDescriptionCount=0;
  int inconsistencyDetected=0;
  int moreInstancesCount=0;
  int nonPerfectCount=0;
  Stat moreInstancesCountStat=new Stat();
  Stat accStat=new Stat();
  Stat accSelectedStat=new Stat();
  Stat accAboveThresholdStat=new Stat();
  Stat positionStat=new Stat();
  int candidatesAboveThresholdCountSC=0;
  int missesCountSC=0;
  int foundDescriptionCountSC=0;
  int noSensibleDescriptionCountSC=0;
  int inconsistencyDetectedSC=0;
  int moreInstancesCountSC=0;
  int nonPerfectCountSC=0;
  Stat moreInstancesCountStatSC=new Stat();
  Stat accStatSC=new Stat();
  Stat accSelectedStatSC=new Stat();
  Stat accAboveThresholdStatSC=new Stat();
  Stat positionStatSC=new Stat();
  Set<NamedClass> classes=new TreeSet<NamedClass>(reasoner.getNamedClasses());
  classes.remove(new NamedClass("String_Node_Str"));
  for (  NamedClass nc : classes) {
    int instanceCount=reasoner.getIndividuals(nc).size();
    if (instanceCount < minInstanceCount) {
      System.out.println("String_Node_Str" + nc.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str"+ instanceCount+ "String_Node_Str"+ minInstanceCount+ "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + nc.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str"+ instanceCount+ "String_Node_Str");
      classCandidatesCount++;
      instanceCountStat.addNumber(instanceCount);
      TreeSet<EvaluatedDescriptionClass> suggestions;
      for (int i=0; i <= 1; i++) {
        ClassLearningProblem lp=cm.learningProblem(ClassLearningProblem.class,reasoner);
        lp.getConfigurator().setClassToDescribe(nc.getURI().toURL());
        if (i == 0) {
          System.out.println("String_Node_Str" + algorithmRuntimeInSeconds + "String_Node_Str");
          lp.getConfigurator().setType("String_Node_Str");
        }
 else {
          System.out.println("String_Node_Str" + algorithmRuntimeInSeconds + "String_Node_Str");
          lp.getConfigurator().setType("String_Node_Str");
        }
        lp.getConfigurator().setUseApproximations(useApproximations);
        lp.init();
        CELOE celoe=cm.learningAlgorithm(CELOE.class,lp,reasoner);
        CELOEConfigurator cf=celoe.getConfigurator();
        cf.setUseNegation(false);
        cf.setValueFrequencyThreshold(3);
        cf.setMaxExecutionTimeInSeconds(algorithmRuntimeInSeconds);
        cf.setNoisePercentage(noisePercent);
        cf.setMaxNrOfResults(10);
        celoe.init();
        celoe.start();
        classExpressionTestsStat.addNumber(celoe.getClassExpressionTests());
        EvaluatedDescription best=celoe.getCurrentlyBestEvaluatedDescription();
        double bestAcc=best.getAccuracy();
        if (i == 0) {
          accStat.addNumber(bestAcc);
        }
 else {
          accStatSC.addNumber(bestAcc);
        }
        if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) {
          System.out.println("String_Node_Str" + (100 * minAccuracy) + "String_Node_Str"+ best.getDescription().toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str"+ df.format(bestAcc)+ "String_Node_Str");
        }
 else {
          if (i == 0) {
            accAboveThresholdStat.addNumber(bestAcc);
            candidatesAboveThresholdCount++;
          }
 else {
            accAboveThresholdStatSC.addNumber(bestAcc);
            candidatesAboveThresholdCountSC++;
          }
          suggestions=(TreeSet<EvaluatedDescriptionClass>)celoe.getCurrentlyBestEvaluatedDescriptions();
          List<EvaluatedDescriptionClass> suggestionsList=new LinkedList<EvaluatedDescriptionClass>(suggestions.descendingSet());
          if (computeApproxDiff) {
            for (            EvaluatedDescription ed : suggestionsList) {
              Description d=ed.getDescription();
              double approx=lp.getAccuracyOrTooWeakApprox(d,noisePercent / (double)100);
              double exact=lp.getAccuracyOrTooWeakExact(d,noisePercent / (double)100);
              double diff=Math.abs(approx - exact);
              if (approx > -0.01 && exact > -0.01) {
                approxDiffStat.addNumber(diff);
              }
            }
          }
          int nr=0;
          for (          EvaluatedDescription suggestion : suggestionsList) {
            System.out.println(nr + "String_Node_Str" + suggestion.getDescription().toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str"+ df.format(suggestion.getAccuracy())+ "String_Node_Str");
            nr++;
          }
          System.out.println("String_Node_Str" + (suggestions.size() - 1) + "String_Node_Str");
          String[] inputs=new String[suggestions.size() + 2];
          inputs[0]="String_Node_Str";
          inputs[1]="String_Node_Str";
          for (int j=0; j < suggestions.size(); j++) {
            inputs[j + 2]="String_Node_Str" + j;
          }
          List<String> allowedInputs=Arrays.asList(inputs);
          String input;
          if (autoMode) {
            input="String_Node_Str";
          }
 else {
            do {
              BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
              input=br.readLine();
            }
 while (!allowedInputs.contains(input));
          }
          userInputProtocol+=input;
          if (input.equals("String_Node_Str")) {
            if (i == 0) {
              missesCount++;
            }
 else {
              missesCountSC++;
            }
            System.out.println("String_Node_Str");
          }
 else           if (input.equals("String_Node_Str")) {
            if (i == 0) {
              noSensibleDescriptionCount++;
            }
 else {
              noSensibleDescriptionCountSC++;
            }
            System.out.println("String_Node_Str");
          }
 else {
            int selectedNr=Integer.parseInt(input);
            EvaluatedDescriptionClass selectedExpression=suggestionsList.get(selectedNr);
            System.out.println("String_Node_Str" + selectedExpression.getDescription().toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str");
            boolean isConsistent=selectedExpression.isConsistent();
            if (!isConsistent) {
              System.out.println("String_Node_Str");
            }
            Set<Individual> addInst=selectedExpression.getAdditionalInstances();
            int additionalInstances=addInst.size();
            if (additionalInstances > 0) {
              System.out.println("String_Node_Str" + additionalInstances + "String_Node_Str"+ addInst.iterator().next().toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str");
            }
            if (i == 0) {
              accSelectedStat.addNumber(bestAcc);
              positionStat.addNumber(selectedNr);
              foundDescriptionCount++;
              if (!isConsistent) {
                inconsistencyDetected++;
              }
              if (additionalInstances > 0) {
                moreInstancesCount++;
                moreInstancesCountStat.addNumber(additionalInstances);
              }
              if (bestAcc < 0.9999) {
                nonPerfectCount++;
              }
            }
 else {
              accSelectedStatSC.addNumber(bestAcc);
              positionStatSC.addNumber(selectedNr);
              foundDescriptionCountSC++;
              if (!isConsistent) {
                inconsistencyDetectedSC++;
              }
              if (additionalInstances > 0) {
                moreInstancesCountSC++;
                moreInstancesCountStatSC.addNumber(additionalInstances);
              }
              if (bestAcc < 0.9999) {
                nonPerfectCountSC++;
              }
            }
          }
        }
        cm.freeComponent(celoe);
        cm.freeComponent(lp);
      }
    }
  }
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println();
  System.out.println("String_Node_Str" + args[0]);
  System.out.println("String_Node_Str" + minAccuracy + "String_Node_Str"+ minInstanceCount+ "String_Node_Str"+ algorithmRuntimeInSeconds+ "String_Node_Str");
  System.out.println("String_Node_Str" + userInputProtocol);
  System.out.println("String_Node_Str" + classes.size());
  System.out.println("String_Node_Str" + minInstanceCount + "String_Node_Str"+ classCandidatesCount);
  System.out.println("String_Node_Str" + classExpressionTestsStat.prettyPrint("String_Node_Str"));
  if (computeApproxDiff) {
    System.out.println("String_Node_Str" + approxDiffStat.prettyPrint());
  }
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + (minAccuracy * 100) + "String_Node_Str"+ candidatesAboveThresholdCount);
  System.out.println("String_Node_Str" + foundDescriptionCount);
  System.out.println("String_Node_Str" + missesCount);
  System.out.println("String_Node_Str" + noSensibleDescriptionCount);
  System.out.println("String_Node_Str" + inconsistencyDetected);
  System.out.println("String_Node_Str" + moreInstancesCountStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accSelectedStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accAboveThresholdStat.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + nonPerfectCount);
  System.out.println("String_Node_Str" + positionStat.prettyPrint("String_Node_Str"));
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + (minAccuracy * 100) + "String_Node_Str"+ candidatesAboveThresholdCountSC);
  System.out.println("String_Node_Str" + foundDescriptionCountSC);
  System.out.println("String_Node_Str" + missesCountSC);
  System.out.println("String_Node_Str" + noSensibleDescriptionCountSC);
  System.out.println("String_Node_Str" + inconsistencyDetectedSC);
  System.out.println("String_Node_Str" + moreInstancesCountStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accSelectedStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + accAboveThresholdStatSC.prettyPrint("String_Node_Str"));
  System.out.println("String_Node_Str" + nonPerfectCountSC);
  System.out.println("String_Node_Str" + positionStatSC.prettyPrint("String_Node_Str"));
}