Program: 108681
Project: 108681
Buggy source:
@Override public GroupStatistics getGroupStatistics(){
  double averageEquivalenceClassSize=0;
  int averageEquivalenceClassSizeCounter=0;
  int maximalEquivalenceClassSize=Integer.MIN_VALUE;
  int minimalEquivalenceClassSize=Integer.MAX_VALUE;
  int numberOfEquivalenceClasses=0;
  int numberOfOutlyingEquivalenceClasses=0;
  int numberOfOutlyingTuples=0;
  HashGroupifyEntry entry=firstEntry;
  while (entry != null) {
    if (entry.count > 0) {
      final boolean anonymous=isAnonymous(entry);
      numberOfEquivalenceClasses++;
      if (!anonymous) {
        numberOfOutlyingEquivalenceClasses++;
        numberOfOutlyingTuples+=entry.count;
      }
 else {
        averageEquivalenceClassSizeCounter+=entry.count;
        maximalEquivalenceClassSize=Math.max(maximalEquivalenceClassSize,entry.count);
        minimalEquivalenceClassSize=Math.min(minimalEquivalenceClassSize,entry.count);
      }
    }
    entry=entry.nextOrdered;
  }
  averageEquivalenceClassSize=(double)averageEquivalenceClassSizeCounter / (double)(numberOfEquivalenceClasses - numberOfOutlyingEquivalenceClasses);
  double averageEquivalenceClassSizeAll=averageEquivalenceClassSize;
  int maximalEquivalenceClassSizeAll=maximalEquivalenceClassSize;
  int minimalEquivalenceClassSizeAll=minimalEquivalenceClassSize;
  if (numberOfOutlyingTuples > 0) {
    averageEquivalenceClassSizeAll=(double)(averageEquivalenceClassSizeCounter + numberOfOutlyingTuples) / (double)(numberOfEquivalenceClasses - numberOfOutlyingEquivalenceClasses + 1);
    maximalEquivalenceClassSizeAll=Math.max(maximalEquivalenceClassSize,numberOfOutlyingTuples);
    minimalEquivalenceClassSizeAll=Math.min(minimalEquivalenceClassSize,numberOfOutlyingTuples);
  }
  return new GroupStatistics(averageEquivalenceClassSize,maximalEquivalenceClassSize,minimalEquivalenceClassSize,averageEquivalenceClassSizeAll,maximalEquivalenceClassSizeAll,minimalEquivalenceClassSizeAll,numberOfEquivalenceClasses,numberOfOutlyingEquivalenceClasses,numberOfOutlyingTuples);
}

Fixed version (ground truth):
@Override public GroupStatistics getGroupStatistics(){
  double averageEquivalenceClassSize=0;
  int averageEquivalenceClassSizeCounter=0;
  int maximalEquivalenceClassSize=Integer.MIN_VALUE;
  int minimalEquivalenceClassSize=Integer.MAX_VALUE;
  int numberOfEquivalenceClasses=0;
  int numberOfOutlyingEquivalenceClasses=0;
  int numberOfOutlyingTuples=0;
  HashGroupifyEntry entry=firstEntry;
  while (entry != null) {
    if (entry.count > 0) {
      final boolean anonymous=isAnonymous(entry);
      numberOfEquivalenceClasses++;
      if (!anonymous) {
        numberOfOutlyingEquivalenceClasses++;
        numberOfOutlyingTuples+=entry.count;
      }
 else {
        averageEquivalenceClassSizeCounter+=entry.count;
        maximalEquivalenceClassSize=Math.max(maximalEquivalenceClassSize,entry.count);
        minimalEquivalenceClassSize=Math.min(minimalEquivalenceClassSize,entry.count);
      }
    }
    entry=entry.nextOrdered;
  }
  if (minimalEquivalenceClassSize == Integer.MAX_VALUE) {
    minimalEquivalenceClassSize=0;
  }
  if (maximalEquivalenceClassSize == Integer.MIN_VALUE) {
    maximalEquivalenceClassSize=0;
  }
  if (numberOfEquivalenceClasses - numberOfOutlyingEquivalenceClasses == 0) {
    averageEquivalenceClassSize=0;
  }
 else {
    averageEquivalenceClassSize=(double)averageEquivalenceClassSizeCounter / (double)(numberOfEquivalenceClasses - numberOfOutlyingEquivalenceClasses);
  }
  double averageEquivalenceClassSizeAll=averageEquivalenceClassSize;
  int maximalEquivalenceClassSizeAll=maximalEquivalenceClassSize;
  int minimalEquivalenceClassSizeAll=minimalEquivalenceClassSize;
  if (averageEquivalenceClassSize != 0 && numberOfOutlyingTuples > 0) {
    averageEquivalenceClassSizeAll=(double)(averageEquivalenceClassSizeCounter + numberOfOutlyingTuples) / (double)(numberOfEquivalenceClasses - numberOfOutlyingEquivalenceClasses + 1);
    maximalEquivalenceClassSizeAll=Math.max(maximalEquivalenceClassSize,numberOfOutlyingTuples);
    minimalEquivalenceClassSizeAll=Math.min(minimalEquivalenceClassSize,numberOfOutlyingTuples);
  }
 else {
    averageEquivalenceClassSizeAll=0;
    maximalEquivalenceClassSizeAll=0;
    minimalEquivalenceClassSizeAll=0;
  }
  return new GroupStatistics(averageEquivalenceClassSize,maximalEquivalenceClassSize,minimalEquivalenceClassSize,averageEquivalenceClassSizeAll,maximalEquivalenceClassSizeAll,minimalEquivalenceClassSizeAll,numberOfEquivalenceClasses,numberOfOutlyingEquivalenceClasses,numberOfOutlyingTuples);
}