Program: 71460
Project: 71460
Buggy source:
/** 
 * @param ds
 * @throws UnexpectedInputException
 */
public DataSetIterator(DataSet ds) throws IllegalArgumentException, ChartException {
  Object oContent=ds.getValues();
  if (ds instanceof NumberDataSet) {
    iDataType=IConstants.NUMERICAL;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof double[]) {
      iContentType=IConstants.PRIMITIVE_ARRAY;
      da=(double[])oContent;
    }
 else     if (oContent instanceof Double[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      dda=(Double[])oContent;
    }
 else     if (oContent instanceof Number) {
      iContentType=IConstants.PRIMITIVE_ARRAY;
      da=new double[]{((Number)oContent).doubleValue()};
    }
  }
 else   if (ds instanceof DateTimeDataSet) {
    iDataType=IConstants.DATE_TIME;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof long[]) {
      iContentType=IConstants.PRIMITIVE_ARRAY;
      la=(long[])oContent;
      cReused=Calendar.getInstance();
    }
 else     if (oContent instanceof Calendar[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      ca=(Calendar[])oContent;
    }
    updateDateTimeValues();
  }
 else   if (ds instanceof TextDataSet) {
    iDataType=IConstants.TEXT;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof String[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      sa=(String[])oContent;
    }
  }
 else   if (ds instanceof NullDataSet) {
    iDataType=IConstants.OTHER;
    iContentType=IConstants.NON_PRIMITIVE_ARRAY;
    oa=(Object[])oContent;
  }
 else {
    iDataType=IConstants.OTHER;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof Object[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      oa=(Object[])oContent;
    }
    iDataType=IConstants.UNDEFINED;
  }
  if (iContentType == IConstants.UNDEFINED) {
    throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle().getString("String_Node_Str"),new Object[]{oContent,ds}));
  }
  if (co != null) {
    it=co.iterator();
  }
  iRowCount=getRowCountInternal();
}

Fixed version (ground truth):
/** 
 * @param ds
 * @throws IllegalArgumentException
 * @throws ChartException
 */
public DataSetIterator(DataSet ds) throws IllegalArgumentException, ChartException {
  Object oContent=ds.getValues();
  if (ds instanceof NumberDataSet) {
    iDataType=IConstants.NUMERICAL;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof double[]) {
      iContentType=IConstants.PRIMITIVE_ARRAY;
      da=(double[])oContent;
    }
 else     if (oContent instanceof Double[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      dda=(Double[])oContent;
    }
 else     if (oContent instanceof Number) {
      iContentType=IConstants.PRIMITIVE_ARRAY;
      da=new double[]{((Number)oContent).doubleValue()};
    }
  }
 else   if (ds instanceof DateTimeDataSet) {
    iDataType=IConstants.DATE_TIME;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof long[]) {
      iContentType=IConstants.PRIMITIVE_ARRAY;
      la=(long[])oContent;
      cReused=Calendar.getInstance();
    }
 else     if (oContent instanceof Calendar[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      ca=(Calendar[])oContent;
    }
    updateDateTimeValues();
  }
 else   if (ds instanceof TextDataSet) {
    iDataType=IConstants.TEXT;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof String[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      sa=(String[])oContent;
    }
  }
 else   if (ds instanceof NullDataSet) {
    iDataType=IConstants.OTHER;
    iContentType=IConstants.NON_PRIMITIVE_ARRAY;
    oa=(Object[])oContent;
  }
 else {
    iDataType=IConstants.OTHER;
    if (oContent instanceof Collection) {
      iContentType=IConstants.COLLECTION;
      co=(Collection)oContent;
    }
 else     if (oContent instanceof Object[]) {
      iContentType=IConstants.NON_PRIMITIVE_ARRAY;
      oa=(Object[])oContent;
    }
    iDataType=IConstants.UNDEFINED;
  }
  if (iContentType == IConstants.UNDEFINED) {
    throw new IllegalArgumentException(MessageFormat.format(Messages.getResourceBundle().getString("String_Node_Str"),new Object[]{oContent,ds}));
  }
  if (co != null) {
    it=co.iterator();
  }
  iRowCount=getRowCountInternal();
}