Program: 69088
Project: 69088
Buggy source:
public Object getMaximum(DataSet ds) throws ChartException {
  DataSetIterator dsi=null;
  try {
    dsi=new DataSetIterator(ds);
    dsi.reset();
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.DATA_SET,uiex);
  }
  if (dsi.size() == 0) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.DATA_SET,"String_Node_Str",Messages.getResourceBundle(getULocale()));
  }
  if (ds instanceof NumberDataSet) {
    boolean bAnyNonNull=false;
    Object o;
    double d, dMax=0;
    while (dsi.hasNext()) {
      o=dsi.next();
      if (o == null) {
        continue;
      }
      d=((Number)o).doubleValue();
      if (!bAnyNonNull) {
        dMax=d;
        bAnyNonNull=true;
      }
 else       if (dMax < d) {
        dMax=d;
      }
    }
    if (!bAnyNonNull) {
      logger.log(new ChartException(ChartEngineExtensionPlugin.ID,ChartException.ALL_NULL_DATASET,"String_Node_Str",Messages.getResourceBundle(getULocale())));
    }
    return new Double(dMax);
  }
 else   if (ds instanceof DateTimeDataSet) {
    boolean bAnyNonNull=false;
    Calendar cal=null;
    Calendar calMax=Calendar.getInstance(getULocale());
    while (dsi.hasNext()) {
      cal=(Calendar)dsi.next();
      if (cal == null) {
        continue;
      }
      if (!bAnyNonNull) {
        calMax=cal;
        bAnyNonNull=true;
      }
 else       if (calMax.before(cal)) {
        calMax=cal;
      }
    }
    if (!bAnyNonNull) {
      logger.log(new ChartException(ChartEngineExtensionPlugin.ID,ChartException.ALL_NULL_DATASET,"String_Node_Str",Messages.getResourceBundle(getULocale())));
    }
    return calMax;
  }
  return null;
}

Fixed version (ground truth):
public Object getMaximum(DataSet ds) throws ChartException {
  DataSetIterator dsi=null;
  try {
    dsi=new DataSetIterator(ds);
    dsi.reset();
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.DATA_SET,uiex);
  }
  if (dsi.size() == 0) {
    throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.DATA_SET,"String_Node_Str",Messages.getResourceBundle(getULocale()));
  }
  if (ds instanceof NumberDataSet) {
    boolean bAnyNonNull=false;
    Object o;
    double d, dMax=0;
    while (dsi.hasNext()) {
      o=dsi.next();
      if (o == null) {
        continue;
      }
      d=((Number)o).doubleValue();
      if (Double.isNaN(d) || Double.isInfinite(dMax)) {
        continue;
      }
      if (!bAnyNonNull) {
        dMax=d;
        bAnyNonNull=true;
      }
 else       if (dMax < d) {
        dMax=d;
      }
    }
    if (!bAnyNonNull) {
      logger.log(new ChartException(ChartEngineExtensionPlugin.ID,ChartException.ALL_NULL_DATASET,"String_Node_Str",Messages.getResourceBundle(getULocale())));
    }
    return new Double(dMax);
  }
 else   if (ds instanceof DateTimeDataSet) {
    boolean bAnyNonNull=false;
    Calendar cal=null;
    Calendar calMax=Calendar.getInstance(getULocale());
    while (dsi.hasNext()) {
      cal=(Calendar)dsi.next();
      if (cal == null) {
        continue;
      }
      if (!bAnyNonNull) {
        calMax=cal;
        bAnyNonNull=true;
      }
 else       if (calMax.before(cal)) {
        calMax=cal;
      }
    }
    if (!bAnyNonNull) {
      logger.log(new ChartException(ChartEngineExtensionPlugin.ID,ChartException.ALL_NULL_DATASET,"String_Node_Str",Messages.getResourceBundle(getULocale())));
    }
    return calMax;
  }
  return null;
}