From 195d7d5af81315e79af52ee52ba904d04ce4587e Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:20:12 +0100 Subject: [PATCH] fixed files form Chart #5 --- projects/Chart/5/org/jfree/data/xy/XYSeries.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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();