Program: 33221
Project: 33221
Buggy source:
@Override public EvaluationCounts countMatchings(List<T> annotatorResult,List<T> goldStandard){
  ClassifiedEvaluationCounts documentCounts=new ClassifiedEvaluationCounts(classifier.getNumberOfClasses());
  BitSet matchingElements;
  BitSet alreadyUsedResults=new BitSet(annotatorResult.size());
  int classId;
  for (  T expectedElement : goldStandard) {
    matchingElements=searcher.findMatchings(expectedElement,annotatorResult,alreadyUsedResults);
    classId=classifier.getClass(expectedElement);
    if (!matchingElements.isEmpty()) {
      ++documentCounts.truePositives;
      ++documentCounts.classifiedCounts[classId].truePositives;
      alreadyUsedResults.set(matchingElements.nextSetBit(0));
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(GerbilConfiguration.getGerbilVersion() + "String_Node_Str" + getUri(expectedElement)+ "String_Node_Str"+ getUri(expectedElement)+ "String_Node_Str");
      }
    }
 else {
      ++documentCounts.falseNegatives;
      ++documentCounts.classifiedCounts[classId].falseNegatives;
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(GerbilConfiguration.getGerbilVersion() + "String_Node_Str" + getUri(expectedElement)+ "String_Node_Str");
      }
    }
  }
  if (LOGGER.isDebugEnabled()) {
    int id=0;
    for (    T element : annotatorResult) {
      if (!alreadyUsedResults.get(id)) {
        LOGGER.debug(GerbilConfiguration.getGerbilVersion() + "String_Node_Str" + getUri(element)+ "String_Node_Str");
      }
      ++id;
    }
  }
  documentCounts.falsePositives=(int)(annotatorResult.size() - alreadyUsedResults.cardinality());
  for (int i=0; i < annotatorResult.size(); ++i) {
    if (!alreadyUsedResults.get(i)) {
      classId=classifier.getClass(annotatorResult.get(i));
      ++documentCounts.classifiedCounts[classId].falsePositives;
    }
  }
  return documentCounts;
}

Fixed version (ground truth):
@Override public EvaluationCounts countMatchings(List<T> annotatorResult,List<T> goldStandard){
  ClassifiedEvaluationCounts documentCounts=new ClassifiedEvaluationCounts(classifier.getNumberOfClasses());
  BitSet matchingElements;
  BitSet alreadyUsedResults=new BitSet(annotatorResult.size());
  int classId, matchingElementId;
  for (  T expectedElement : goldStandard) {
    matchingElements=searcher.findMatchings(expectedElement,annotatorResult,alreadyUsedResults);
    classId=classifier.getClass(expectedElement);
    if (!matchingElements.isEmpty()) {
      ++documentCounts.truePositives;
      ++documentCounts.classifiedCounts[classId].truePositives;
      matchingElementId=matchingElements.nextSetBit(0);
      alreadyUsedResults.set(matchingElementId);
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(GerbilConfiguration.getGerbilVersion() + "String_Node_Str" + getUri(expectedElement)+ "String_Node_Str"+ getUri(annotatorResult.get(matchingElementId))+ "String_Node_Str");
      }
    }
 else {
      ++documentCounts.falseNegatives;
      ++documentCounts.classifiedCounts[classId].falseNegatives;
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(GerbilConfiguration.getGerbilVersion() + "String_Node_Str" + getUri(expectedElement)+ "String_Node_Str");
      }
    }
  }
  if (LOGGER.isDebugEnabled()) {
    int id=0;
    for (    T element : annotatorResult) {
      if (!alreadyUsedResults.get(id)) {
        LOGGER.debug(GerbilConfiguration.getGerbilVersion() + "String_Node_Str" + getUri(element)+ "String_Node_Str");
      }
      ++id;
    }
  }
  documentCounts.falsePositives=(int)(annotatorResult.size() - alreadyUsedResults.cardinality());
  for (int i=0; i < annotatorResult.size(); ++i) {
    if (!alreadyUsedResults.get(i)) {
      classId=classifier.getClass(annotatorResult.get(i));
      ++documentCounts.classifiedCounts[classId].falsePositives;
    }
  }
  return documentCounts;
}