Program: 13813
Project: 13813
Buggy source:
/** 
 * Construct the basic JVM metrics using a supplied SignalFuse MetricFactory.
 * @param metricRegistry
 */
public BasicJvmMetrics(MetricRegistry metricRegistry){
  runtimeBean=ManagementFactory.getRuntimeMXBean();
  memoryBean=ManagementFactory.getMemoryMXBean();
  threadBean=ManagementFactory.getThreadMXBean();
  for (  GarbageCollectorMXBean gcBean : ManagementFactory.getGarbageCollectorMXBeans()) {
    allGcBeans.add(gcBean);
    Set<String> poolNames=new HashSet<String>(Arrays.asList(gcBean.getMemoryPoolNames()));
    if (poolNames.contains(OLD_GEN_POOL_NAME)) {
      oldGenGcBeans.add(gcBean);
    }
 else {
      youngGenGcBeans.add(gcBean);
    }
  }
  this.uptimeGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new UptimeCallback());
  this.totalMemoryGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new TotalMemoryCallback());
  this.usedMemoryGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new UsedMemoryCallback());
  this.maxMemoryGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new MaxMemoryCallback());
  this.cpuLoadGauge=createDoublePeriodicGauge(metricRegistry,"String_Node_Str",new CpuLoadCallback());
  this.totalThreadCountGauge=createIntegerPeriodicGauge(metricRegistry,"String_Node_Str",new TotalThreadCountCallback());
  this.daemonThreadCountGauge=createIntegerPeriodicGauge(metricRegistry,"String_Node_Str",new DaemonThreadCountCallback());
  this.gcTimeGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new GcTimeCallback());
  this.gcLoadGauge=createDoublePeriodicGauge(metricRegistry,"String_Node_Str",new GcLoadCallback());
  this.gcYoungCountGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new GcCountCallback(youngGenGcBeans));
  this.gcOldCountGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new GcCountCallback(oldGenGcBeans));
}

Fixed version (ground truth):
/** 
 * Construct the basic JVM metrics using a supplied SignalFuse MetricFactory.
 * @param metricRegistry The registry to give these metrics to
 */
public BasicJvmMetrics(MetricRegistry metricRegistry){
  runtimeBean=ManagementFactory.getRuntimeMXBean();
  memoryBean=ManagementFactory.getMemoryMXBean();
  threadBean=ManagementFactory.getThreadMXBean();
  for (  GarbageCollectorMXBean gcBean : ManagementFactory.getGarbageCollectorMXBeans()) {
    allGcBeans.add(gcBean);
    Set<String> poolNames=new HashSet<String>(Arrays.asList(gcBean.getMemoryPoolNames()));
    if (poolNames.contains(OLD_GEN_POOL_NAME)) {
      oldGenGcBeans.add(gcBean);
    }
 else {
      youngGenGcBeans.add(gcBean);
    }
  }
  this.uptimeGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new UptimeCallback());
  this.totalMemoryGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new TotalMemoryCallback());
  this.usedMemoryGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new UsedMemoryCallback());
  this.maxMemoryGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new MaxMemoryCallback());
  this.cpuLoadGauge=createDoublePeriodicGauge(metricRegistry,"String_Node_Str",new CpuLoadCallback());
  this.totalThreadCountGauge=createIntegerPeriodicGauge(metricRegistry,"String_Node_Str",new TotalThreadCountCallback());
  this.daemonThreadCountGauge=createIntegerPeriodicGauge(metricRegistry,"String_Node_Str",new DaemonThreadCountCallback());
  this.gcTimeGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new GcTimeCallback());
  this.gcLoadGauge=createDoublePeriodicGauge(metricRegistry,"String_Node_Str",new GcLoadCallback());
  this.gcYoungCountGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new GcCountCallback(youngGenGcBeans));
  this.gcOldCountGauge=createPeriodicGauge(metricRegistry,"String_Node_Str",new GcCountCallback(oldGenGcBeans));
}