Program: 9669
Project: 9669
Buggy source:
@Override public void init() throws ComponentInitException {
  Set<NamedClass> usedConcepts;
  Set<NamedClass> allowedConcepts=CommonConfigMappings.getAtomicConceptSet(configurator.getAllowedConcepts());
  Set<NamedClass> ignoredConcepts=CommonConfigMappings.getAtomicConceptSet(configurator.getIgnoredConcepts());
  if (allowedConcepts != null) {
    Helper.checkConcepts(reasoner,allowedConcepts);
    usedConcepts=allowedConcepts;
  }
 else   if (ignoredConcepts != null) {
    usedConcepts=Helper.computeConceptsUsingIgnoreList(reasoner,ignoredConcepts);
  }
 else {
    usedConcepts=Helper.computeConcepts(reasoner);
  }
  ClassHierarchy classHierarchy=reasoner.getClassHierarchy().cloneAndRestrict(usedConcepts);
  classHierarchy.thinOutSubsumptionHierarchy();
  heuristic=new OEHeuristicRuntime(configurator);
  minimizer=new DescriptionMinimizer(reasoner);
  startClass=Thing.instance;
  singleSuggestionMode=configurator.getSingleSuggestionMode();
  operator=new RhoDRDown(reasoner,classHierarchy,startClass,configurator);
  baseURI=reasoner.getBaseURI();
  prefixes=reasoner.getPrefixes();
  if (configurator.getWriteSearchTree()) {
    Files.clearFile(new File(configurator.getSearchTreeFile()));
  }
  bestEvaluatedDescriptions=new EvaluatedDescriptionSet(configurator.getMaxNrOfResults());
  isClassLearningProblem=(learningProblem instanceof ClassLearningProblem);
  noise=configurator.getNoisePercentage() / 100d;
  maxDepth=configurator.getMaxDepth();
  filterFollowsFromKB=configurator.getFilterDescriptionsFollowingFromKB() && isClassLearningProblem;
  if (isClassLearningProblem) {
    ClassLearningProblem problem=(ClassLearningProblem)learningProblem;
    classToDescribe=problem.getClassToDescribe();
    isEquivalenceProblem=problem.isEquivalenceProblem();
    examples=reasoner.getIndividuals(classToDescribe);
    if (isEquivalenceProblem) {
      Set<Description> existingDefinitions=reasoner.getAssertedDefinitions(classToDescribe);
      if (configurator.getReuseExistingDescription() && (existingDefinitions.size() > 0)) {
        Description existingDefinition=null;
        int highestLength=0;
        for (        Description exDef : existingDefinitions) {
          if (exDef.getLength() > highestLength) {
            existingDefinition=exDef;
            highestLength=exDef.getLength();
          }
        }
        LinkedList<Description> startClassCandidates=new LinkedList<Description>();
        startClassCandidates.add(existingDefinition);
        ((RhoDRDown)operator).setDropDisjuncts(true);
        RefinementOperator upwardOperator=new OperatorInverter(operator);
        boolean startClassFound=false;
        Description candidate;
        do {
          candidate=startClassCandidates.pollFirst();
          if (((ClassLearningProblem)learningProblem).getRecall(candidate) < 1.0) {
            Set<Description> refinements=upwardOperator.refine(candidate,candidate.getLength());
            LinkedList<Description> refinementList=new LinkedList<Description>(refinements);
            startClassCandidates.addAll(refinementList);
          }
 else {
            startClassFound=true;
          }
        }
 while (!startClassFound);
        startClass=candidate;
        if (startClass.equals(existingDefinition)) {
          logger.info("String_Node_Str" + startClass.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str");
        }
 else {
          logger.info("String_Node_Str" + existingDefinition.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str"+ startClass.toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str");
        }
        ((RhoDRDown)operator).setDropDisjuncts(false);
      }
 else {
        Set<Description> superClasses=reasoner.getClassHierarchy().getSuperClasses(classToDescribe);
        if (superClasses.size() > 1) {
          startClass=new Intersection(new LinkedList<Description>(superClasses));
        }
 else         if (superClasses.size() == 1) {
          startClass=(Description)superClasses.toArray()[0];
        }
 else {
          startClass=Thing.instance;
          logger.warn(classToDescribe + "String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
 else   if (learningProblem instanceof PosOnlyLP) {
    examples=((PosOnlyLP)learningProblem).getPositiveExamples();
  }
 else   if (learningProblem instanceof PosNegLP) {
    examples=Helper.union(((PosNegLP)learningProblem).getPositiveExamples(),((PosNegLP)learningProblem).getNegativeExamples());
  }
}

Fixed version (ground truth):
@Override public void init() throws ComponentInitException {
  Set<NamedClass> usedConcepts;
  Set<NamedClass> allowedConcepts=configurator.getAllowedConcepts() == null ? null : CommonConfigMappings.getAtomicConceptSet(configurator.getAllowedConcepts());
  Set<NamedClass> ignoredConcepts=configurator.getIgnoredConcepts() == null ? null : CommonConfigMappings.getAtomicConceptSet(configurator.getIgnoredConcepts());
  if (allowedConcepts != null) {
    Helper.checkConcepts(reasoner,allowedConcepts);
    usedConcepts=allowedConcepts;
  }
 else   if (ignoredConcepts != null) {
    usedConcepts=Helper.computeConceptsUsingIgnoreList(reasoner,ignoredConcepts);
  }
 else {
    usedConcepts=Helper.computeConcepts(reasoner);
  }
  ClassHierarchy classHierarchy=reasoner.getClassHierarchy().cloneAndRestrict(usedConcepts);
  classHierarchy.thinOutSubsumptionHierarchy();
  heuristic=new OEHeuristicRuntime(configurator);
  minimizer=new DescriptionMinimizer(reasoner);
  startClass=Thing.instance;
  singleSuggestionMode=configurator.getSingleSuggestionMode();
  operator=new RhoDRDown(reasoner,classHierarchy,startClass,configurator);
  baseURI=reasoner.getBaseURI();
  prefixes=reasoner.getPrefixes();
  if (configurator.getWriteSearchTree()) {
    Files.clearFile(new File(configurator.getSearchTreeFile()));
  }
  bestEvaluatedDescriptions=new EvaluatedDescriptionSet(configurator.getMaxNrOfResults());
  isClassLearningProblem=(learningProblem instanceof ClassLearningProblem);
  noise=configurator.getNoisePercentage() / 100d;
  maxDepth=configurator.getMaxDepth();
  filterFollowsFromKB=configurator.getFilterDescriptionsFollowingFromKB() && isClassLearningProblem;
  if (isClassLearningProblem) {
    ClassLearningProblem problem=(ClassLearningProblem)learningProblem;
    classToDescribe=problem.getClassToDescribe();
    isEquivalenceProblem=problem.isEquivalenceProblem();
    examples=reasoner.getIndividuals(classToDescribe);
    if (isEquivalenceProblem) {
      Set<Description> existingDefinitions=reasoner.getAssertedDefinitions(classToDescribe);
      if (configurator.getReuseExistingDescription() && (existingDefinitions.size() > 0)) {
        Description existingDefinition=null;
        int highestLength=0;
        for (        Description exDef : existingDefinitions) {
          if (exDef.getLength() > highestLength) {
            existingDefinition=exDef;
            highestLength=exDef.getLength();
          }
        }
        LinkedList<Description> startClassCandidates=new LinkedList<Description>();
        startClassCandidates.add(existingDefinition);
        ((RhoDRDown)operator).setDropDisjuncts(true);
        RefinementOperator upwardOperator=new OperatorInverter(operator);
        boolean startClassFound=false;
        Description candidate;
        do {
          candidate=startClassCandidates.pollFirst();
          if (((ClassLearningProblem)learningProblem).getRecall(candidate) < 1.0) {
            Set<Description> refinements=upwardOperator.refine(candidate,candidate.getLength());
            LinkedList<Description> refinementList=new LinkedList<Description>(refinements);
            startClassCandidates.addAll(refinementList);
          }
 else {
            startClassFound=true;
          }
        }
 while (!startClassFound);
        startClass=candidate;
        if (startClass.equals(existingDefinition)) {
          logger.info("String_Node_Str" + startClass.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str");
        }
 else {
          logger.info("String_Node_Str" + existingDefinition.toManchesterSyntaxString(baseURI,prefixes) + "String_Node_Str"+ startClass.toManchesterSyntaxString(baseURI,prefixes)+ "String_Node_Str");
        }
        ((RhoDRDown)operator).setDropDisjuncts(false);
      }
 else {
        Set<Description> superClasses=reasoner.getClassHierarchy().getSuperClasses(classToDescribe);
        if (superClasses.size() > 1) {
          startClass=new Intersection(new LinkedList<Description>(superClasses));
        }
 else         if (superClasses.size() == 1) {
          startClass=(Description)superClasses.toArray()[0];
        }
 else {
          startClass=Thing.instance;
          logger.warn(classToDescribe + "String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
 else   if (learningProblem instanceof PosOnlyLP) {
    examples=((PosOnlyLP)learningProblem).getPositiveExamples();
  }
 else   if (learningProblem instanceof PosNegLP) {
    examples=Helper.union(((PosNegLP)learningProblem).getPositiveExamples(),((PosNegLP)learningProblem).getNegativeExamples());
  }
}