Program: 9007
Project: 9007
Buggy source:
private void updateAndLogTimes(String operation,long start,int paramSize,int resultSize){
  long now=now();
  if (startTime == 0) {
    startTime=now;
  }
  Count c=counts.get(operation);
  if (c == null) {
    c=new Count();
    counts.put(operation,c);
  }
  c.update(now - start,paramSize,resultSize);
  long t=now - lastLogTime;
  if (t >= 10000) {
    totalLogTime+=t;
    lastLogTime=now;
    long totalCount=0, totalTime=0;
    for (    Count count : counts.values()) {
      totalCount+=count.count;
      totalTime+=count.total;
    }
    totalCount=Math.max(1,totalCount);
    totalTime=Math.max(1,totalTime);
    for (    Entry<String,Count> e : counts.entrySet()) {
      c=e.getValue();
      long count=c.count;
      long total=c.total;
      long in=c.paramSize / 1024 / 1024;
      long out=c.resultSize / 1024 / 1024;
      if (count > 0) {
        log(e.getKey() + "String_Node_Str" + count+ "String_Node_Str"+ (100 * count / totalCount)+ "String_Node_Str"+ "String_Node_Str"+ in+ "String_Node_Str"+ out+ "String_Node_Str"+ total+ "String_Node_Str"+ (100 * total / totalTime)+ "String_Node_Str");
      }
    }
    log("String_Node_Str" + totalCount + "String_Node_Str"+ totalTime+ "String_Node_Str"+ (100 * totalTime / totalLogTime)+ "String_Node_Str");
    HashMap<String,Integer> map=commonCalls;
    int top=10;
    int max=Integer.MAX_VALUE;
    for (int i=0; i < top; ) {
      int best=0;
      for (      int x : map.values()) {
        if (x < max && x > best) {
          best=x;
        }
      }
      for (      Entry<String,Integer> e : map.entrySet()) {
        if (e.getValue() >= best && e.getValue() < max) {
          log("String_Node_Str" + e.getValue() + "String_Node_Str"+ e.getKey());
          i++;
          if (i >= top) {
            break;
          }
        }
      }
      max=best;
    }
    commonCalls.clear();
    log("String_Node_Str");
  }
}

Fixed version (ground truth):
private void updateAndLogTimes(String operation,long start,int paramSize,int resultSize){
  long now=now();
  if (startTime == 0) {
    startTime=now;
  }
  Count c=counts.get(operation);
  if (c == null) {
    c=new Count();
    counts.put(operation,c);
  }
  c.update(now - start,paramSize,resultSize);
  long t=now - lastLogTime;
  if (t >= 10000) {
    totalLogTime+=t;
    lastLogTime=now;
    long totalCount=0, totalTime=0;
    for (    Count count : counts.values()) {
      totalCount+=count.count;
      totalTime+=count.total;
    }
    totalCount=Math.max(1,totalCount);
    totalTime=Math.max(1,totalTime);
    for (    Entry<String,Count> e : counts.entrySet()) {
      c=e.getValue();
      long count=c.count;
      long total=c.total;
      long in=c.paramSize / 1024 / 1024;
      long out=c.resultSize / 1024 / 1024;
      if (count > 0) {
        log(e.getKey() + "String_Node_Str" + count+ "String_Node_Str"+ (100 * count / totalCount)+ "String_Node_Str"+ "String_Node_Str"+ in+ "String_Node_Str"+ out+ "String_Node_Str"+ total+ "String_Node_Str"+ (100 * total / totalTime)+ "String_Node_Str");
      }
    }
    log("String_Node_Str" + totalCount + "String_Node_Str"+ totalTime+ "String_Node_Str"+ (100 * totalTime / totalLogTime)+ "String_Node_Str");
    Map<String,Integer> map=slowCalls;
    int top=10;
    int max=Integer.MAX_VALUE;
    for (int i=0; i < top; ) {
      int best=0;
      for (      int x : map.values()) {
        if (x < max && x > best) {
          best=x;
        }
      }
      for (      Entry<String,Integer> e : map.entrySet()) {
        if (e.getValue() >= best && e.getValue() < max) {
          log("String_Node_Str" + e.getValue() + "String_Node_Str"+ e.getKey());
          i++;
          if (i >= top) {
            break;
          }
        }
      }
      if (i >= map.size()) {
        break;
      }
      max=best;
    }
    slowCalls.clear();
    log("String_Node_Str");
  }
}