Program: 47776
Project: 47776
Buggy source:
/** 
 * Returns the range of x-values in the specified dataset for the data items belonging to the visible series.
 * @param dataset  the dataset ({@code null} not permitted).
 * @param visibleSeriesKeys  the visible series keys ({@code null} notpermitted).
 * @param includeInterval  a flag that determines whether or not they-interval for the dataset is included (this only applies if the dataset is an instance of IntervalXYDataset).
 * @return The x-range (possibly {@code null}).
 * @since 1.0.13
 */
public static Range iterateToFindDomainBounds(XYDataset dataset,List<Comparable> visibleSeriesKeys,boolean includeInterval){
  ParamChecks.nullNotPermitted(dataset,"String_Node_Str");
  ParamChecks.nullNotPermitted(visibleSeriesKeys,"String_Node_Str");
  double minimum=Double.POSITIVE_INFINITY;
  double maximum=Double.NEGATIVE_INFINITY;
  if (includeInterval && dataset instanceof IntervalXYDataset) {
    IntervalXYDataset ixyd=(IntervalXYDataset)dataset;
    for (    Comparable seriesKey : visibleSeriesKeys) {
      int series=dataset.indexOf(seriesKey);
      int itemCount=dataset.getItemCount(series);
      for (int item=0; item < itemCount; item++) {
        double lvalue=ixyd.getStartXValue(series,item);
        double uvalue=ixyd.getEndXValue(series,item);
        if (!Double.isNaN(lvalue)) {
          minimum=Math.min(minimum,lvalue);
        }
        if (!Double.isNaN(uvalue)) {
          maximum=Math.max(maximum,uvalue);
        }
      }
    }
  }
 else {
    for (    Comparable seriesKey : visibleSeriesKeys) {
      int series=dataset.indexOf(seriesKey);
      int itemCount=dataset.getItemCount(series);
      for (int item=0; item < itemCount; item++) {
        double x=dataset.getXValue(series,item);
        if (!Double.isNaN(x)) {
          minimum=Math.min(minimum,x);
          maximum=Math.max(maximum,x);
        }
      }
    }
  }
  if (minimum == Double.POSITIVE_INFINITY) {
    return null;
  }
 else {
    return new Range(minimum,maximum);
  }
}

Fixed version (ground truth):
/** 
 * Returns the range of x-values in the specified dataset for the data items belonging to the visible series.
 * @param dataset  the dataset ({@code null} not permitted).
 * @param visibleSeriesKeys  the visible series keys ({@code null} notpermitted).
 * @param includeInterval  a flag that determines whether or not they-interval for the dataset is included (this only applies if the dataset is an instance of IntervalXYDataset).
 * @return The x-range (possibly {@code null}).
 * @since 1.0.13
 */
public static Range iterateToFindDomainBounds(XYDataset dataset,List<Comparable> visibleSeriesKeys,boolean includeInterval){
  ParamChecks.nullNotPermitted(dataset,"String_Node_Str");
  ParamChecks.nullNotPermitted(visibleSeriesKeys,"String_Node_Str");
  double minimum=Double.POSITIVE_INFINITY;
  double maximum=Double.NEGATIVE_INFINITY;
  if (includeInterval && dataset instanceof IntervalXYDataset) {
    IntervalXYDataset ixyd=(IntervalXYDataset)dataset;
    for (    Comparable seriesKey : visibleSeriesKeys) {
      int series=dataset.indexOf(seriesKey);
      int itemCount=dataset.getItemCount(series);
      for (int item=0; item < itemCount; item++) {
        double xvalue=ixyd.getXValue(series,item);
        double lvalue=ixyd.getStartXValue(series,item);
        double uvalue=ixyd.getEndXValue(series,item);
        if (!Double.isNaN(xvalue)) {
          minimum=Math.min(minimum,xvalue);
          maximum=Math.max(maximum,xvalue);
        }
        if (!Double.isNaN(lvalue)) {
          minimum=Math.min(minimum,lvalue);
        }
        if (!Double.isNaN(uvalue)) {
          maximum=Math.max(maximum,uvalue);
        }
      }
    }
  }
 else {
    for (    Comparable seriesKey : visibleSeriesKeys) {
      int series=dataset.indexOf(seriesKey);
      int itemCount=dataset.getItemCount(series);
      for (int item=0; item < itemCount; item++) {
        double x=dataset.getXValue(series,item);
        if (!Double.isNaN(x)) {
          minimum=Math.min(minimum,x);
          maximum=Math.max(maximum,x);
        }
      }
    }
  }
  if (minimum == Double.POSITIVE_INFINITY) {
    return null;
  }
 else {
    return new Range(minimum,maximum);
  }
}