Program: 9904
Project: 9904
Buggy source:
/** 
 * 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);
  logger.debug("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)) {
      logger.debug("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 laconicExplanations;
}

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);
  logger.debug("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)) {
      logger.debug("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) {
    System.out.println(explanation);
    if (!nonLaconicExplanations.contains(explanation)) {
      if (laconicExplanations.contains(explanation)) {
        explanations.add(explanation);
      }
 else       if (isLaconic(explanation)) {
        explanations.add(explanation);
      }
    }
  }
  return explanations;
}