Program: 31186
Project: 31186
Buggy source:
/** 
 * Draws a row for a piece of data in the message and also a sparkline for that data.
 * @param cls type of the data
 * @param name name of the entry in the message
 * @param o the data itself
 * @param isstatic true if the data is static
 * @param sec index of section this row is in, used to determine if thisrow should be highlighted because it is under the mouse cursor.
 */
public void drawStringsAndGraph(Class cls,String name,Object o,boolean isstatic,int sec){
  Section cs=sections.get(sec);
  double value=Double.NaN;
  if (o instanceof Double)   value=(Double)o;
 else   if (o instanceof Float)   value=(Float)o;
 else   if (o instanceof Integer)   value=(Integer)o;
 else   if (o instanceof Long)   value=(Long)o;
 else   if (o instanceof Byte)   value=(Byte)o;
  if (collapse_depth > 0) {
    SparklineData data=cs.sparklines.get(name);
    if (data.chart != null && updateGraphs) {
      ITrace2D trace=data.chart.getTraces().first();
      trace.addPoint((double)utime / 1000000.0d,value);
    }
    return;
  }
  if (isstatic) {
    drawStrings(cls.getName(),name,o.toString(),isstatic);
    return;
  }
  Color oldColor=g.getColor();
  boolean isHovering=false;
  if (currentlyHoveringSection != null && cs == currentlyHoveringSection && currentlyHoveringName.equals(name)) {
    isHovering=true;
    g.setColor(Color.RED);
  }
  Font of=g.getFont();
  g.drawString(cls.getName(),x[0] + indent_level * indentpx,y);
  g.drawString(name,x[1],y);
  if (cls.equals(Byte.TYPE)) {
    g.drawString(String.format("String_Node_Str",((Byte)o),((Byte)o).intValue() & 0x00FF,((Byte)o),((Byte)o) & 0xff),x[2],y);
  }
 else {
    g.drawString(o.toString(),x[2],y);
  }
  g.setColor(oldColor);
  if (!Double.isNaN(value)) {
    SparklineData data=cs.sparklines.get(name);
    if (data.chart == null) {
      data.chart=InitChart(name);
    }
    Chart2D chart=data.chart;
    ITrace2D trace=chart.getTraces().first();
    data.xmin=x[3];
    data.xmax=x[3] + sparklineWidth;
    if (updateGraphs) {
      trace.addPoint((double)utime / 1000000.0d,value);
    }
    DrawSparkline(x[3],y,trace,isHovering);
  }
  y+=textheight;
  g.setFont(of);
  g.setColor(oldColor);
}

Fixed version (ground truth):
/** 
 * Draws a row for a piece of data in the message and also a sparkline for that data.
 * @param cls type of the data
 * @param name name of the entry in the message
 * @param o the data itself
 * @param isstatic true if the data is static
 * @param sec index of section this row is in, used to determine if thisrow should be highlighted because it is under the mouse cursor.
 */
public void drawStringsAndGraph(Class cls,String name,Object o,boolean isstatic,int sec){
  Section cs=sections.get(sec);
  double value=Double.NaN;
  if (o instanceof Double)   value=(Double)o;
 else   if (o instanceof Float)   value=(Float)o;
 else   if (o instanceof Integer)   value=(Integer)o;
 else   if (o instanceof Long)   value=(Long)o;
 else   if (o instanceof Byte)   value=(Byte)o;
  if (collapse_depth > 0) {
    SparklineData data=cs.sparklines.get(name);
    if (data.chart != null) {
      ITrace2D trace=data.chart.getTraces().first();
      trace.addPoint((double)utime / 1000000.0d,value);
    }
    return;
  }
  if (isstatic) {
    drawStrings(cls.getName(),name,o.toString(),isstatic);
    return;
  }
  Color oldColor=g.getColor();
  boolean isHovering=false;
  if (currentlyHoveringSection != null && cs == currentlyHoveringSection && currentlyHoveringName.equals(name)) {
    isHovering=true;
    g.setColor(Color.RED);
  }
  Font of=g.getFont();
  g.drawString(cls.getName(),x[0] + indent_level * indentpx,y);
  g.drawString(name,x[1],y);
  if (cls.equals(Byte.TYPE)) {
    g.drawString(String.format("String_Node_Str",((Byte)o),((Byte)o).intValue() & 0x00FF,((Byte)o),((Byte)o) & 0xff),x[2],y);
  }
 else {
    g.drawString(o.toString(),x[2],y);
  }
  g.setColor(oldColor);
  if (!Double.isNaN(value)) {
    SparklineData data=cs.sparklines.get(name);
    if (data.chart == null) {
      data.chart=InitChart(name);
    }
    Chart2D chart=data.chart;
    ITrace2D trace=chart.getTraces().first();
    data.xmin=x[3];
    data.xmax=x[3] + sparklineWidth;
    trace.addPoint((double)utime / 1000000.0d,value);
    DrawSparkline(x[3],y,trace,isHovering);
  }
  y+=textheight;
  g.setFont(of);
  g.setColor(oldColor);
}