Program: 9903
Project: 9903
Buggy source:
public List<Set<OWLAxiom>> computeClassificationImpact(List<OWLOntologyChange> changes){
  List<Set<OWLAxiom>> impact=new ArrayList<Set<OWLAxiom>>(2);
  Set<OWLAxiom> entailmentsBefore=new HashSet<OWLAxiom>();
  Set<OWLAxiom> entailmentsAfter=new HashSet<OWLAxiom>();
  Set<OWLAxiom> lostEntailments=new HashSet<OWLAxiom>();
  Set<OWLAxiom> addedEntailents=new HashSet<OWLAxiom>();
  try {
    Set<OWLClass> inc=classifier.getInconsistentClasses();
    for (    OWLDescription cl : ontology.getClassesInSignature()) {
      if (!inc.contains(cl) && !cl.isOWLThing()) {
        for (        OWLClass sub : SetUtils.union(classifier.getDescendantClasses(cl))) {
          if (!sub.isOWLNothing() && !inc.contains(sub)) {
            entailmentsBefore.add(factory.getOWLSubClassAxiom(sub,cl));
          }
        }
        for (        OWLClass equ : classifier.getEquivalentClasses(cl)) {
          if (!equ.isOWLNothing() && !inc.contains(equ)) {
            entailmentsBefore.add(factory.getOWLEquivalentClassesAxiom(equ,cl));
          }
        }
      }
    }
    manager.applyChanges(changes);
    classifier.classify();
    inc=classifier.getInconsistentClasses();
    for (    OWLDescription cl : ontology.getClassesInSignature()) {
      if (!inc.contains(cl) && !cl.isOWLThing()) {
        for (        OWLClass sub : SetUtils.union(classifier.getDescendantClasses(cl))) {
          if (!sub.isOWLNothing() && !inc.contains(sub)) {
            entailmentsAfter.add(factory.getOWLSubClassAxiom(sub,cl));
          }
        }
      }
      for (      OWLClass equ : classifier.getEquivalentClasses(cl)) {
        if (!equ.isOWLNothing() && !inc.contains(equ)) {
          entailmentsAfter.add(factory.getOWLEquivalentClassesAxiom(equ,cl));
        }
      }
    }
    lostEntailments=SetUtils.difference(entailmentsBefore,entailmentsAfter);
    addedEntailents=SetUtils.difference(entailmentsAfter,entailmentsBefore);
    impact.add(0,lostEntailments);
    impact.add(1,addedEntailents);
    manager.applyChanges(getInverseChanges(changes));
  }
 catch (  OWLReasonerException e) {
    e.printStackTrace();
  }
catch (  OWLOntologyChangeException e) {
    e.printStackTrace();
  }
  return impact;
}

Fixed version (ground truth):
public List<Set<OWLAxiom>> computeClassificationImpact(List<OWLOntologyChange> changes){
  List<Set<OWLAxiom>> impact=new ArrayList<Set<OWLAxiom>>(2);
  Set<OWLAxiom> entailmentsBefore=new HashSet<OWLAxiom>();
  Set<OWLAxiom> entailmentsAfter=new HashSet<OWLAxiom>();
  Set<OWLAxiom> lostEntailments=new HashSet<OWLAxiom>();
  Set<OWLAxiom> addedEntailents=new HashSet<OWLAxiom>();
  try {
    Set<OWLClass> inc=classifier.getInconsistentClasses();
    for (    OWLDescription cl : ontology.getClassesInSignature()) {
      if (!inc.contains(cl) && !cl.isOWLThing()) {
        for (        OWLClass sub : SetUtils.union(classifier.getDescendantClasses(cl))) {
          if (!sub.isOWLNothing() && !inc.contains(sub)) {
            entailmentsBefore.add(factory.getOWLSubClassAxiom(sub,cl));
          }
        }
        for (        OWLClass equ : classifier.getEquivalentClasses(cl)) {
          if (!equ.isOWLNothing() && !inc.contains(equ)) {
            entailmentsBefore.add(factory.getOWLEquivalentClassesAxiom(equ,cl));
          }
        }
      }
    }
    manager.applyChanges(changes);
    classifier.classify();
    inc=classifier.getInconsistentClasses();
    for (    OWLDescription cl : ontology.getClassesInSignature()) {
      if (!inc.contains(cl) && !cl.isOWLThing()) {
        for (        OWLClass sub : SetUtils.union(classifier.getDescendantClasses(cl))) {
          if (!sub.isOWLNothing() && !inc.contains(sub)) {
            entailmentsAfter.add(factory.getOWLSubClassAxiom(sub,cl));
          }
        }
      }
      for (      OWLClass equ : classifier.getEquivalentClasses(cl)) {
        if (!equ.isOWLNothing() && !inc.contains(equ)) {
          entailmentsAfter.add(factory.getOWLEquivalentClassesAxiom(equ,cl));
        }
      }
    }
    lostEntailments=SetUtils.difference(entailmentsBefore,entailmentsAfter);
    addedEntailents=SetUtils.difference(entailmentsAfter,entailmentsBefore);
    for (    OWLOntologyChange change : changes) {
      if (change instanceof RemoveAxiom) {
        lostEntailments.remove(change.getAxiom());
      }
    }
    impact.add(0,lostEntailments);
    impact.add(1,addedEntailents);
    manager.applyChanges(getInverseChanges(changes));
  }
 catch (  OWLReasonerException e) {
    e.printStackTrace();
  }
catch (  OWLOntologyChangeException e) {
    e.printStackTrace();
  }
  return impact;
}