diff --git a/projects/Chart/16/org/jfree/data/category/DefaultIntervalCategoryDataset.java b/projects/Chart/16/org/jfree/data/category/DefaultIntervalCategoryDataset.java index 2efdfcb..bde3922 100644 --- a/projects/Chart/16/org/jfree/data/category/DefaultIntervalCategoryDataset.java +++ b/projects/Chart/16/org/jfree/data/category/DefaultIntervalCategoryDataset.java @@ -204,8 +204,8 @@ public DefaultIntervalCategoryDataset(Comparable[] seriesKeys, } else { - this.seriesKeys = null; - this.categoryKeys = null; + this.seriesKeys = new Comparable[0]; + this.categoryKeys = new Comparable[0]; } } @@ -335,7 +335,7 @@ public void setCategoryKeys(Comparable[] categoryKeys) { if (categoryKeys == null) { throw new IllegalArgumentException("Null 'categoryKeys' argument."); } - if (categoryKeys.length != this.startData[0].length) { + if (categoryKeys.length != getCategoryCount()) { throw new IllegalArgumentException( "The number of categories does not match the data."); }