diff --git a/projects/Chart/5/org/jfree/data/xy/XYSeries.java b/projects/Chart/5/org/jfree/data/xy/XYSeries.java index 0b37e6e..b26e11e 100644 --- a/projects/Chart/5/org/jfree/data/xy/XYSeries.java +++ b/projects/Chart/5/org/jfree/data/xy/XYSeries.java @@ -541,11 +541,15 @@ public XYDataItem addOrUpdate(Number x, Number y) { if (x == null) { throw new IllegalArgumentException("Null 'x' argument."); } + if (this.allowDuplicateXValues) { + add(x, y); + return null; + } // if we get to here, we know that duplicate X values are not permitted XYDataItem overwritten = null; int index = indexOf(x); - if (index >= 0 && !this.allowDuplicateXValues) { + if (index >= 0) { XYDataItem existing = (XYDataItem) this.data.get(index); try { overwritten = (XYDataItem) existing.clone();