Program: 24586
Project: 24586
Buggy source:
public void doGraph(StaplerRequest req,StaplerResponse rsp) throws IOException {
  String category=req.getParameter("String_Node_Str");
  logger.fine("String_Node_Str" + category);
  int width=500, height=200;
  String w=req.getParameter("String_Node_Str");
  String h=req.getParameter("String_Node_Str");
  if (w != null && w.length() > 0) {
    width=Integer.parseInt(w);
  }
  if (h != null && h.length() > 0) {
    height=Integer.parseInt(h);
  }
  if (category == null) {
    throw new IOException("String_Node_Str");
  }
  if (ChartUtil.awtProblemCause != null) {
    rsp.sendRedirect2(req.getContextPath() + "String_Node_Str");
    return;
  }
  Calendar t=build.getTimestamp();
  if (req.checkIfModified(t,rsp)) {
    return;
  }
  DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel> dsb=new DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel>();
  float health=100.0f;
  int min=1000000, max=-110001100;
  String scale="String_Node_Str";
  boolean latest=true;
  for (MonKitBuildAction a=this; a != null; a=a.getPreviousResult()) {
    logger.finest("String_Node_Str" + a.getDisplayName());
    ChartUtil.NumberOnlyBuildLabel label=new ChartUtil.NumberOnlyBuildLabel(a.build);
    for (    MonKitCategory mkc : a.getMonKitCategories()) {
      if (mkc.getName().equalsIgnoreCase(category)) {
        MonKitTarget mkt=publisher.getTarget(category);
        Float fu=null;
        Float fh=null;
        if (mkt != null) {
          fu=new Float(mkt.getUnstable());
          fh=new Float(mkt.getHealthy());
          dsb.add(fh,"String_Node_Str",label);
          if (max < fh) {
            max=(int)Math.floor(fh);
          }
          dsb.add(fu,"String_Node_Str",label);
          if (min > fu) {
            min=(int)Math.floor(fu);
          }
        }
        logger.finer("String_Node_Str" + fu);
        logger.finer("String_Node_Str" + fh);
        Float f=0f;
        for (        MonKitObservation mko : mkc) {
          try {
            f=new Float(mko.getValue());
          }
 catch (          NumberFormatException e) {
            System.err.println("String_Node_Str" + mko.getValue());
            continue;
          }
          logger.fine("String_Node_Str" + mko.getName() + "String_Node_Str"+ f+ "String_Node_Str");
          dsb.add(f,mko.getName(),label);
          if (f.intValue() > max) {
            max=f.intValue() + 1;
          }
          if (f.intValue() < min) {
            min=f.intValue();
            if (min != 0) {
              min--;
            }
          }
          if (latest) {
            scale=mkc.getScale();
          }
        }
        if (latest && mkt != null) {
          boolean isGreater=fu < fh;
          logger.finer("String_Node_Str" + fu + "String_Node_Str"+ fh+ "String_Node_Str"+ isGreater);
          if ((isGreater && f < fu) || (!isGreater && f > fu)) {
            logger.fine("String_Node_Str");
            health=0.0f;
          }
 else           if ((isGreater && f < fh) || (!isGreater && f > fh)) {
            float diff=fh - fu;
            float nf1=f - fu;
            float inter=(nf1 / diff) * 100;
            logger.fine("String_Node_Str" + diff + "String_Node_Str"+ nf1+ "String_Node_Str"+ inter);
            if (inter < health) {
              logger.fine("String_Node_Str" + inter);
              health=inter;
            }
          }
        }
      }
    }
    latest=false;
  }
  if (health < 100.0f) {
    logger.fine("String_Node_Str" + health);
    category+="String_Node_Str" + (Math.abs(Math.floor(health * 100)) / 100) + "String_Node_Str";
  }
  ChartUtil.generateGraph(req,rsp,createChart(dsb.build(),category,scale,max,min),width,height);
}

Fixed version (ground truth):
public void doGraph(StaplerRequest req,StaplerResponse rsp) throws IOException {
  String category=req.getParameter("String_Node_Str");
  logger.fine("String_Node_Str" + category);
  int width=500, height=200;
  String w=req.getParameter("String_Node_Str");
  String h=req.getParameter("String_Node_Str");
  if (w != null && w.length() > 0) {
    width=Integer.parseInt(w);
  }
  if (h != null && h.length() > 0) {
    height=Integer.parseInt(h);
  }
  if (category == null) {
    throw new IOException("String_Node_Str");
  }
  if (ChartUtil.awtProblemCause != null) {
    rsp.sendRedirect2(req.getContextPath() + "String_Node_Str");
    return;
  }
  Calendar t=build.getTimestamp();
  if (req.checkIfModified(t,rsp)) {
    return;
  }
  DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel> dsb=new DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel>();
  float health=100.0f;
  int min=1000000, max=-110001100;
  String scale="String_Node_Str";
  boolean latest=true;
  for (MonKitBuildAction a=this; a != null; a=a.getPreviousResult()) {
    logger.finest("String_Node_Str" + a.getDisplayName());
    ChartUtil.NumberOnlyBuildLabel label=new ChartUtil.NumberOnlyBuildLabel(a.build);
    for (    MonKitCategory mkc : a.getMonKitCategories()) {
      if (mkc.getName().equalsIgnoreCase(category)) {
        MonKitTarget mkt=publisher.getTarget(category);
        Float fu=null;
        Float fh=null;
        if (mkt != null) {
          fu=new Float(mkt.getUnstable());
          fh=new Float(mkt.getHealthy());
          dsb.add(fh,"String_Node_Str",label);
          if (max < fh) {
            max=(int)Math.floor(fh);
          }
          dsb.add(fu,"String_Node_Str",label);
          if (min > fu) {
            min=(int)Math.floor(fu);
          }
        }
        logger.finer("String_Node_Str" + fu);
        logger.finer("String_Node_Str" + fh);
        Float f=0f;
        for (        MonKitObservation mko : mkc) {
          try {
            f=new Float(mko.getValue());
          }
 catch (          NumberFormatException e) {
            System.err.println("String_Node_Str" + mko.getValue());
            continue;
          }
          logger.fine("String_Node_Str" + mko.getName() + "String_Node_Str"+ f+ "String_Node_Str");
          dsb.add(f,mko.getName(),label);
          if (f.intValue() > max) {
            max=f.intValue() + 1;
          }
          if (f.intValue() < min) {
            min=f.intValue();
            if (min != 0) {
              min--;
            }
          }
          if (latest) {
            scale=mkc.getScale();
          }
          if (latest && mkt != null) {
            boolean isGreater=fu < fh;
            logger.finer("String_Node_Str" + fu + "String_Node_Str"+ fh+ "String_Node_Str"+ isGreater);
            if ((isGreater && f < fu) || (!isGreater && f > fu)) {
              logger.fine("String_Node_Str");
              health=0.0f;
            }
 else             if ((isGreater && f < fh) || (!isGreater && f > fh)) {
              float diff=fh - fu;
              float nf1=f - fu;
              float inter=(nf1 / diff) * 100;
              logger.finer("String_Node_Str" + diff + "String_Node_Str"+ nf1+ "String_Node_Str"+ inter);
              if (inter < health) {
                logger.fine("String_Node_Str" + inter);
                health=inter;
              }
            }
          }
        }
      }
    }
    latest=false;
  }
  if (health < 100.0f) {
    logger.fine("String_Node_Str" + health);
    category+="String_Node_Str" + (Math.abs(Math.floor(health * 100)) / 100) + "String_Node_Str";
  }
  ChartUtil.generateGraph(req,rsp,createChart(dsb.build(),category,scale,max,min),width,height);
}