Skip to content

Commit

Permalink
fixed files form Chart #5
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 4d50a62 commit 195d7d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion projects/Chart/5/org/jfree/data/xy/XYSeries.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 195d7d5

Please sign in to comment.