Program: 9397
Project: 9397
Buggy source:
public double getAccuracyOrTooWeakExact(OWLClassExpression description,double noise){
  nanoStartTime=System.nanoTime();
  if (heuristic.equals(HeuristicType.JACCARD)) {
    TreeSet<OWLIndividual> coveredInstancesSet=new TreeSet<OWLIndividual>();
    for (    OWLIndividual ind : classInstances) {
      if (getReasoner().hasType(description,ind)) {
        coveredInstancesSet.add(ind);
      }
      if (terminationTimeExpired()) {
        return 0;
      }
    }
    if (coveredInstancesSet.size() / (double)classInstances.size() <= 1 - noise) {
      return -1;
    }
    TreeSet<OWLIndividual> additionalInstancesSet=new TreeSet<OWLIndividual>();
    for (    OWLIndividual ind : superClassInstances) {
      if (getReasoner().hasType(description,ind)) {
        additionalInstancesSet.add(ind);
      }
      if (terminationTimeExpired()) {
        return 0;
      }
    }
    Set<OWLIndividual> union=Helper.union(classInstancesSet,additionalInstancesSet);
    return Heuristics.getJaccardCoefficient(coveredInstancesSet.size(),union.size());
  }
 else   if (heuristic.equals(HeuristicType.AMEASURE) || heuristic.equals(HeuristicType.FMEASURE) || heuristic.equals(HeuristicType.PRED_ACC)) {
    int additionalInstances=0;
    if (useInstanceChecks) {
      for (      OWLIndividual ind : superClassInstances) {
        if (getReasoner().hasType(description,ind)) {
          additionalInstances++;
        }
        if (terminationTimeExpired()) {
          return 0;
        }
      }
    }
 else {
      SortedSet<OWLIndividual> individuals=getReasoner().getIndividuals(description);
      individuals.retainAll(superClassInstances);
      additionalInstances=individuals.size();
    }
    int coveredInstances=0;
    if (useInstanceChecks) {
      for (      OWLIndividual ind : classInstances) {
        if (getReasoner().hasType(description,ind)) {
          coveredInstances++;
        }
        if (terminationTimeExpired()) {
          return 0;
        }
      }
    }
 else {
      SortedSet<OWLIndividual> individuals=getReasoner().getIndividuals(description);
      individuals.retainAll(classInstances);
      coveredInstances=individuals.size();
    }
    System.out.println(description + "String_Node_Str" + coveredInstances+ "String_Node_Str"+ classInstances.size());
    double recall=coveredInstances / (double)classInstances.size();
    double precision=(additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double)(coveredInstances + additionalInstances);
    if (heuristic.equals(HeuristicType.AMEASURE)) {
      if ((coverageFactor * recall + 1) / (double)(coverageFactor + 1) < (1 - noise)) {
        return -1;
      }
 else {
        return Heuristics.getAScore(recall,precision,coverageFactor);
      }
    }
 else     if (heuristic.equals(HeuristicType.FMEASURE)) {
      if (((1 + Math.sqrt(coverageFactor)) * recall) / (Math.sqrt(coverageFactor) + 1) < 1 - noise) {
        return -1;
      }
 else {
        return getFMeasure(recall,precision);
      }
    }
 else     if (heuristic.equals(HeuristicType.PRED_ACC)) {
      if ((coverageFactor * coveredInstances + superClassInstances.size()) / (double)(coverageFactor * classInstances.size() + superClassInstances.size()) < 1 - noise) {
        return -1;
      }
 else {
        return (coverageFactor * coveredInstances + superClassInstances.size() - additionalInstances) / (double)(coverageFactor * classInstances.size() + superClassInstances.size());
      }
    }
  }
 else   if (heuristic.equals(HeuristicType.GEN_FMEASURE)) {
    TreeSet<OWLIndividual> icPos=new TreeSet<OWLIndividual>();
    TreeSet<OWLIndividual> icNeg=new TreeSet<OWLIndividual>();
    OWLClassExpression descriptionNeg=df.getOWLObjectComplementOf(description);
    for (    OWLIndividual ind : classAndSuperClassInstances) {
      if (getReasoner().hasType(description,ind)) {
        icPos.add(ind);
      }
 else       if (getReasoner().hasType(descriptionNeg,ind)) {
        icNeg.add(ind);
      }
      if (terminationTimeExpired()) {
        return 0;
      }
    }
    Set<OWLIndividual> tmp1Pos=Helper.intersection(icPos,classInstancesSet);
    Set<OWLIndividual> tmp1Neg=Helper.intersection(icNeg,negatedClassInstances);
    int tmp1Size=tmp1Pos.size() + tmp1Neg.size();
    int icSize=icPos.size() + icNeg.size();
    double prec=(icSize == 0) ? 0 : tmp1Size / (double)icSize;
    double rec=tmp1Size / (double)(classInstances.size() + negatedClassInstances.size());
    if (rec <= 0.0000001) {
      return -1;
    }
    return getFMeasure(rec,prec);
  }
  throw new Error("String_Node_Str");
}

Fixed version (ground truth):
public double getAccuracyOrTooWeakExact(OWLClassExpression description,double noise){
  nanoStartTime=System.nanoTime();
  if (heuristic.equals(HeuristicType.JACCARD)) {
    TreeSet<OWLIndividual> coveredInstancesSet=new TreeSet<OWLIndividual>();
    for (    OWLIndividual ind : classInstances) {
      if (getReasoner().hasType(description,ind)) {
        coveredInstancesSet.add(ind);
      }
      if (terminationTimeExpired()) {
        return 0;
      }
    }
    if (coveredInstancesSet.size() / (double)classInstances.size() <= 1 - noise) {
      return -1;
    }
    TreeSet<OWLIndividual> additionalInstancesSet=new TreeSet<OWLIndividual>();
    for (    OWLIndividual ind : superClassInstances) {
      if (getReasoner().hasType(description,ind)) {
        additionalInstancesSet.add(ind);
      }
      if (terminationTimeExpired()) {
        return 0;
      }
    }
    Set<OWLIndividual> union=Helper.union(classInstancesSet,additionalInstancesSet);
    return Heuristics.getJaccardCoefficient(coveredInstancesSet.size(),union.size());
  }
 else   if (heuristic.equals(HeuristicType.AMEASURE) || heuristic.equals(HeuristicType.FMEASURE) || heuristic.equals(HeuristicType.PRED_ACC)) {
    int additionalInstances=0;
    if (useInstanceChecks) {
      for (      OWLIndividual ind : superClassInstances) {
        if (getReasoner().hasType(description,ind)) {
          additionalInstances++;
        }
        if (terminationTimeExpired()) {
          return 0;
        }
      }
    }
 else {
      SortedSet<OWLIndividual> individuals=getReasoner().getIndividuals(description);
      individuals.retainAll(superClassInstances);
      additionalInstances=individuals.size();
    }
    int coveredInstances=0;
    if (useInstanceChecks) {
      for (      OWLIndividual ind : classInstances) {
        if (getReasoner().hasType(description,ind)) {
          coveredInstances++;
        }
        if (terminationTimeExpired()) {
          return 0;
        }
      }
    }
 else {
      SortedSet<OWLIndividual> individuals=getReasoner().getIndividuals(description);
      individuals.retainAll(classInstances);
      coveredInstances=individuals.size();
    }
    double recall=coveredInstances / (double)classInstances.size();
    double precision=(additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double)(coveredInstances + additionalInstances);
    if (heuristic.equals(HeuristicType.AMEASURE)) {
      if ((coverageFactor * recall + 1) / (double)(coverageFactor + 1) < (1 - noise)) {
        return -1;
      }
 else {
        return Heuristics.getAScore(recall,precision,coverageFactor);
      }
    }
 else     if (heuristic.equals(HeuristicType.FMEASURE)) {
      if (((1 + Math.sqrt(coverageFactor)) * recall) / (Math.sqrt(coverageFactor) + 1) < 1 - noise) {
        return -1;
      }
 else {
        return getFMeasure(recall,precision);
      }
    }
 else     if (heuristic.equals(HeuristicType.PRED_ACC)) {
      if ((coverageFactor * coveredInstances + superClassInstances.size()) / (double)(coverageFactor * classInstances.size() + superClassInstances.size()) < 1 - noise) {
        return -1;
      }
 else {
        return (coverageFactor * coveredInstances + superClassInstances.size() - additionalInstances) / (double)(coverageFactor * classInstances.size() + superClassInstances.size());
      }
    }
  }
 else   if (heuristic.equals(HeuristicType.GEN_FMEASURE)) {
    TreeSet<OWLIndividual> icPos=new TreeSet<OWLIndividual>();
    TreeSet<OWLIndividual> icNeg=new TreeSet<OWLIndividual>();
    OWLClassExpression descriptionNeg=df.getOWLObjectComplementOf(description);
    for (    OWLIndividual ind : classAndSuperClassInstances) {
      if (getReasoner().hasType(description,ind)) {
        icPos.add(ind);
      }
 else       if (getReasoner().hasType(descriptionNeg,ind)) {
        icNeg.add(ind);
      }
      if (terminationTimeExpired()) {
        return 0;
      }
    }
    Set<OWLIndividual> tmp1Pos=Helper.intersection(icPos,classInstancesSet);
    Set<OWLIndividual> tmp1Neg=Helper.intersection(icNeg,negatedClassInstances);
    int tmp1Size=tmp1Pos.size() + tmp1Neg.size();
    int icSize=icPos.size() + icNeg.size();
    double prec=(icSize == 0) ? 0 : tmp1Size / (double)icSize;
    double rec=tmp1Size / (double)(classInstances.size() + negatedClassInstances.size());
    if (rec <= 0.0000001) {
      return -1;
    }
    return getFMeasure(rec,prec);
  }
  throw new Error("String_Node_Str");
}