Program: 9882
Project: 9882
Buggy source:
/** 
 * Computes the precise explanations
 * @param entailment
 * @param limit
 * @return
 * @throws OWLException
 */
public Set<Explanation> computePreciseJusts(OWLAxiom entailment,int limit) throws OWLException {
  Set<Explanation> regularExplanations=pelletExplanation.getExplanations((OWLAxiom)entailment);
  System.out.println(new StringBuilder().append("String_Node_Str").append(regularExplanations.size()).toString());
  lastRegularExplanations.clear();
  lastRegularExplanations.addAll(regularExplanations);
  allPreviouslyFoundExplanations=new HashSet<Explanation>();
  allPreviouslyFoundExplanations.addAll(regularExplanations);
  Set<Explanation> nonLaconicExplanations=new HashSet<Explanation>();
  Set<Explanation> laconicExplanations=new HashSet<Explanation>();
  Set<OWLAxiom> axiomsInPreviousOntology=new HashSet<OWLAxiom>();
  long counter=0L;
  for (; ; ) {
    counter++;
    System.out.println(new StringBuilder().append("String_Node_Str").append(counter).toString());
    Set<OWLAxiom> unionOfAllExplanations=new HashSet<OWLAxiom>();
    for (    Explanation expl : allPreviouslyFoundExplanations) {
      unionOfAllExplanations.addAll(expl.getAxioms());
    }
    Set<OWLAxiom> oPlus=computeOPlus(unionOfAllExplanations);
    OWLOntologyManager man2=OWLManager.createOWLOntologyManager();
    OWLOntology extendedOntology=man2.createOntology(oPlus);
    for (    OWLLogicalAxiom logAx : ontology.getLogicalAxioms()) {
      if (!unionOfAllExplanations.contains(logAx) || oPlus.contains(logAx)) {
        man2.addAxiom(extendedOntology,logAx);
      }
    }
    if (extendedOntology.getLogicalAxioms().equals(axiomsInPreviousOntology)) {
      System.out.println("String_Node_Str");
      break;
    }
    axiomsInPreviousOntology.clear();
    axiomsInPreviousOntology.addAll(extendedOntology.getLogicalAxioms());
    Set<Explanation> allPrevJustsCopy=new HashSet<Explanation>(allPreviouslyFoundExplanations);
    Set<OWLOntology> ont2=new HashSet<OWLOntology>();
    ont2.add(extendedOntology);
    PelletExplanationGenerator expGen=new PelletExplanationGenerator(man2,ont2);
    Set<Explanation> currentExplanations=expGen.getExplanations((OWLAxiom)entailment);
    allPreviouslyFoundExplanations.addAll(currentExplanations);
    if (allPreviouslyFoundExplanations.equals(allPrevJustsCopy)) {
      break;
    }
    for (    Explanation currentExplanation : currentExplanations) {
      if (!laconicExplanations.contains(currentExplanation) && !nonLaconicExplanations.contains(currentExplanation)) {
        if (isLaconic(currentExplanation)) {
          laconicExplanations.add(currentExplanation);
        }
 else {
          nonLaconicExplanations.add(currentExplanation);
        }
        if (laconicExplanations.size() == limit) {
          return laconicExplanations;
        }
      }
    }
  }
  Set<Explanation> explanations=new HashSet<Explanation>();
  for (  Explanation explanation : allPreviouslyFoundExplanations) {
    if (!nonLaconicExplanations.contains(explanation)) {
      if (laconicExplanations.contains(explanation)) {
        explanations.add(explanation);
      }
 else       if (isLaconic(explanation)) {
        explanations.add(explanation);
      }
    }
  }
  return retrieveAxioms(explanations);
}

Fixed version (ground truth):
/** 
 * Computes the precise explanations
 * @param entailment
 * @param limit
 * @return
 * @throws OWLException
 */
private Set<Explanation> computePreciseJusts(OWLAxiom entailment,int limit) throws OWLException {
  Set<Explanation> regularExplanations=pelletExplanation.getExplanations((OWLAxiom)entailment);
  if (log.isLoggable(Level.CONFIG)) {
    log.config("String_Node_Str" + regularExplanations.size() + "String_Node_Str");
  }
  lastRegularExplanations.clear();
  lastRegularExplanations.addAll(regularExplanations);
  allPreviouslyFoundExplanations=new HashSet<Explanation>();
  allPreviouslyFoundExplanations.addAll(regularExplanations);
  Set<Explanation> nonLaconicExplanations=new HashSet<Explanation>();
  Set<Explanation> laconicExplanations=new HashSet<Explanation>();
  Set<OWLAxiom> axiomsInPreviousOntology=new HashSet<OWLAxiom>();
  for (; ; ) {
    if (progressMonitor.isCancelled()) {
      return laconicExplanations;
    }
    Set<OWLAxiom> unionOfAllExplanations=new HashSet<OWLAxiom>();
    for (    Explanation expl : allPreviouslyFoundExplanations) {
      unionOfAllExplanations.addAll(expl.getAxioms());
    }
    Set<OWLAxiom> oPlus=computeOPlus(unionOfAllExplanations);
    OWLOntologyManager man2=OWLManager.createOWLOntologyManager();
    OWLOntology extendedOntology=man2.createOntology(oPlus);
    for (    OWLLogicalAxiom logAx : ontology.getLogicalAxioms()) {
      if (!unionOfAllExplanations.contains(logAx) || oPlus.contains(logAx)) {
        man2.addAxiom(extendedOntology,logAx);
      }
    }
    if (extendedOntology.getLogicalAxioms().equals(axiomsInPreviousOntology)) {
      if (log.isLoggable(Level.CONFIG)) {
        log.config("String_Node_Str");
      }
      break;
    }
    axiomsInPreviousOntology.clear();
    axiomsInPreviousOntology.addAll(extendedOntology.getLogicalAxioms());
    Set<Explanation> allPrevJustsCopy=new HashSet<Explanation>(allPreviouslyFoundExplanations);
    Set<OWLOntology> ont2=new HashSet<OWLOntology>();
    ont2.add(extendedOntology);
    PelletExplanationGenerator expGen=new PelletExplanationGenerator(man2,ont2);
    Set<Explanation> currentExplanations=expGen.getExplanations((OWLAxiom)entailment);
    allPreviouslyFoundExplanations.addAll(currentExplanations);
    if (allPreviouslyFoundExplanations.equals(allPrevJustsCopy)) {
      break;
    }
    for (    Explanation currentExplanation : currentExplanations) {
      if (!laconicExplanations.contains(currentExplanation) && !nonLaconicExplanations.contains(currentExplanation)) {
        if (isLaconic(currentExplanation)) {
          laconicExplanations.add(currentExplanation);
        }
 else {
          nonLaconicExplanations.add(currentExplanation);
        }
        if (laconicExplanations.size() == limit) {
          return laconicExplanations;
        }
      }
    }
  }
  Set<Explanation> explanations=new HashSet<Explanation>();
  for (  Explanation explanation : allPreviouslyFoundExplanations) {
    if (!nonLaconicExplanations.contains(explanation)) {
      if (laconicExplanations.contains(explanation)) {
        explanations.add(explanation);
      }
 else       if (isLaconic(explanation)) {
        explanations.add(explanation);
      }
    }
  }
  return retrieveAxioms(explanations);
}