Program: 18596
Project: 18596
Buggy source:
public void setMetric(ServiceMetric metric,MetricData data){
  SummaryPanel panel=null;
  String date1Header="String_Node_Str";
  String date2Header="String_Node_Str";
  if (data != null) {
    String d1=ConsoleUtil.shotTimeFormat.format(new Date(data.getMetricCriteria().date1));
    String d2=ConsoleUtil.shotTimeFormat.format(new Date(data.getMetricCriteria().date2));
    date1Header=d1 + "String_Node_Str" + (data.getMetricCriteria().durationSec / (60 * 60))+ ConsoleUtil.constants.hr();
    date2Header=d2 + "String_Node_Str" + (data.getMetricCriteria().durationSec / (60 * 60))+ ConsoleUtil.constants.hr();
  }
switch (metric) {
case TopVolume:
{
      String count=ConsoleUtil.constants.count();
      String[] columns={ConsoleUtil.constants.operations(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
      List<String[]> rows=new ArrayList<String[]>();
      if (data != null) {
        for (int i=0; i < data.getReturnData().size(); i++) {
          MetricGroupData rd=data.getReturnData().get(i);
          String[] rowData=new String[4];
          rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
          rowData[1]=rd.getCount1();
          rowData[2]=rd.getCount2();
          rowData[3]=rd.getDiff();
          rows.add(rowData);
        }
      }
      setTabularData(topVolumeTable,columns,rows,null);
      panel=topVolumePanel;
      break;
    }
case LeastPerformance:
{
    String avg=ConsoleUtil.constants.average();
    String[] columns={ConsoleUtil.constants.operations(),(data == null ? avg : date1Header + "String_Node_Str" + avg+ "String_Node_Str"),(data == null ? avg : date2Header + "String_Node_Str" + avg+ "String_Node_Str"),"String_Node_Str" + ConsoleUtil.constants.change()};
    List<String[]> rows=new ArrayList<String[]>();
    if (data != null) {
      for (int i=0; i < data.getReturnData().size(); i++) {
        MetricGroupData rd=data.getReturnData().get(i);
        String[] rowData=new String[4];
        rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
        double d1=Double.parseDouble(rd.getCount1()) / 1000.0;
        double d2=Double.parseDouble(rd.getCount1()) / 1000.0;
        rowData[1]=String.valueOf(d1);
        rowData[2]=String.valueOf(d2);
        rowData[3]=rd.getDiff();
        rows.add(rowData);
      }
    }
    setTabularData(leastPerformanceTable,columns,rows,null);
    panel=leastPerformancePanel;
    break;
  }
case TopErrors:
{
  String count=ConsoleUtil.constants.count();
  String[] columns={ConsoleUtil.constants.errors(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
  List<String[]> rows=new ArrayList<String[]>();
  if (data != null) {
    for (int i=0; i < data.getReturnData().size(); i++) {
      MetricGroupData rd=data.getReturnData().get(i);
      String[] rowData=new String[4];
      rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
      rowData[1]=rd.getCount1();
      rowData[2]=rd.getCount2();
      rowData[3]=rd.getDiff();
      rows.add(rowData);
    }
  }
  setTabularData(topErrorsTable,columns,rows,null);
  panel=topErrorsPanel;
  break;
}
case ConsumerTraffic:
{
String count=ConsoleUtil.constants.count();
String[] columns={ConsoleUtil.constants.consumers(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
List<String[]> rows=new ArrayList<String[]>();
if (data != null) {
  for (int i=0; i < data.getReturnData().size(); i++) {
    MetricGroupData rd=data.getReturnData().get(i);
    String[] rowData=new String[4];
    rowData[0]=ConsoleUtil.convertConsumerFromMissing(rd.getCriteriaInfo().getConsumerName());
    rowData[1]=rd.getCount1();
    rowData[2]=rd.getCount2();
    rowData[3]=rd.getDiff();
    rows.add(rowData);
  }
}
setTabularData(consumerTrafficTable,columns,rows,new String[]{"String_Node_Str",null,null});
panel=consumerTrafficPanel;
break;
}
case ConsumerErrors:
{
String count=ConsoleUtil.constants.count();
String[] columns={ConsoleUtil.constants.consumers(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
List<String[]> rows=new ArrayList<String[]>();
if (data != null) {
for (int i=0; i < data.getReturnData().size(); i++) {
  MetricGroupData rd=data.getReturnData().get(i);
  String[] rowData=new String[4];
  rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
  rowData[1]=rd.getCount1();
  rowData[2]=rd.getCount2();
  rowData[3]=rd.getDiff();
  rows.add(rowData);
}
}
setTabularData(consumerErrorsTable,columns,rows,new String[]{"String_Node_Str",null,null});
panel=consumerErrorsPanel;
break;
}
}
if (data != null && data.getReturnData() != null && panel != null) {
int rows=data.getReturnData().size() + 1;
double height=0;
if (rows > 10) height=10 * 2.5;
 else height=rows * 2.5;
panel.setContentContainerHeight(String.valueOf(height) + "String_Node_Str");
}
if (panel != null) {
if (data != null) panel.setInfo(data.getRestUrl());
show(panel);
}
}

Fixed version (ground truth):
public void setMetric(ServiceMetric metric,MetricData data){
  SummaryPanel panel=null;
  String date1Header="String_Node_Str";
  String date2Header="String_Node_Str";
  if (data != null) {
    String d1=ConsoleUtil.shotTimeFormat.format(new Date(data.getMetricCriteria().date1));
    String d2=ConsoleUtil.shotTimeFormat.format(new Date(data.getMetricCriteria().date2));
    date1Header=d1 + "String_Node_Str" + (data.getMetricCriteria().durationSec / (60 * 60))+ ConsoleUtil.constants.hr();
    date2Header=d2 + "String_Node_Str" + (data.getMetricCriteria().durationSec / (60 * 60))+ ConsoleUtil.constants.hr();
  }
switch (metric) {
case TopVolume:
{
      String count=ConsoleUtil.constants.count();
      String[] columns={ConsoleUtil.constants.operations(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
      List<String[]> rows=new ArrayList<String[]>();
      if (data != null) {
        for (int i=0; i < data.getReturnData().size(); i++) {
          MetricGroupData rd=data.getReturnData().get(i);
          String[] rowData=new String[4];
          rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
          rowData[1]=rd.getCount1();
          rowData[2]=rd.getCount2();
          rowData[3]=rd.getDiff();
          rows.add(rowData);
        }
      }
      setTabularData(topVolumeTable,columns,rows,null);
      panel=topVolumePanel;
      break;
    }
case LeastPerformance:
{
    String avg=ConsoleUtil.constants.average();
    String[] columns={ConsoleUtil.constants.operations(),(data == null ? avg : date1Header + "String_Node_Str" + avg+ "String_Node_Str"),(data == null ? avg : date2Header + "String_Node_Str" + avg+ "String_Node_Str"),"String_Node_Str" + ConsoleUtil.constants.change()};
    List<String[]> rows=new ArrayList<String[]>();
    if (data != null) {
      for (int i=0; i < data.getReturnData().size(); i++) {
        MetricGroupData rd=data.getReturnData().get(i);
        String[] rowData=new String[4];
        rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
        double d1=Double.parseDouble(rd.getCount1()) / 1000.0;
        double d2=Double.parseDouble(rd.getCount2()) / 1000.0;
        rowData[1]=String.valueOf(d1);
        rowData[2]=String.valueOf(d2);
        rowData[3]=rd.getDiff();
        rows.add(rowData);
      }
    }
    setTabularData(leastPerformanceTable,columns,rows,null);
    panel=leastPerformancePanel;
    break;
  }
case TopErrors:
{
  String count=ConsoleUtil.constants.count();
  String[] columns={ConsoleUtil.constants.errors(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
  List<String[]> rows=new ArrayList<String[]>();
  if (data != null) {
    for (int i=0; i < data.getReturnData().size(); i++) {
      MetricGroupData rd=data.getReturnData().get(i);
      String[] rowData=new String[4];
      rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
      rowData[1]=rd.getCount1();
      rowData[2]=rd.getCount2();
      rowData[3]=rd.getDiff();
      rows.add(rowData);
    }
  }
  setTabularData(topErrorsTable,columns,rows,null);
  panel=topErrorsPanel;
  break;
}
case ConsumerTraffic:
{
String count=ConsoleUtil.constants.count();
String[] columns={ConsoleUtil.constants.consumers(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
List<String[]> rows=new ArrayList<String[]>();
if (data != null) {
  for (int i=0; i < data.getReturnData().size(); i++) {
    MetricGroupData rd=data.getReturnData().get(i);
    String[] rowData=new String[4];
    rowData[0]=ConsoleUtil.convertConsumerFromMissing(rd.getCriteriaInfo().getConsumerName());
    rowData[1]=rd.getCount1();
    rowData[2]=rd.getCount2();
    rowData[3]=rd.getDiff();
    rows.add(rowData);
  }
}
setTabularData(consumerTrafficTable,columns,rows,new String[]{"String_Node_Str",null,null});
panel=consumerTrafficPanel;
break;
}
case ConsumerErrors:
{
String count=ConsoleUtil.constants.count();
String[] columns={ConsoleUtil.constants.consumers(),(data == null ? count : date1Header + "String_Node_Str" + count),(data == null ? count : date2Header + "String_Node_Str" + count),"String_Node_Str" + ConsoleUtil.constants.change()};
List<String[]> rows=new ArrayList<String[]>();
if (data != null) {
for (int i=0; i < data.getReturnData().size(); i++) {
  MetricGroupData rd=data.getReturnData().get(i);
  String[] rowData=new String[4];
  rowData[0]=getEntityName(metric,data.getMetricResourceCriteria().resourceEntityResponseType,rd);
  rowData[1]=rd.getCount1();
  rowData[2]=rd.getCount2();
  rowData[3]=rd.getDiff();
  rows.add(rowData);
}
}
setTabularData(consumerErrorsTable,columns,rows,new String[]{"String_Node_Str",null,null});
panel=consumerErrorsPanel;
break;
}
}
if (data != null && data.getReturnData() != null && panel != null) {
int rows=data.getReturnData().size() + 1;
double height=0;
if (rows > 10) height=10 * 2.5;
 else height=rows * 2.5;
panel.setContentContainerHeight(String.valueOf(height) + "String_Node_Str");
}
if (panel != null) {
if (data != null) panel.setInfo(data.getRestUrl());
show(panel);
}
}