Skip to content
Snippets Groups Projects
Commit 349d341d authored by Tim Molter's avatar Tim Molter
Browse files

Issue #81 ConcurrentModificationException - I changed the type of List in the...

Issue #81 ConcurrentModificationException - I changed the type of List in the demos and the exception disappears.
parent 8928be62
No related branches found
No related tags found
No related merge requests found
......@@ -15,10 +15,10 @@
*/
package com.xeiam.xchart.demo.charts.realtime;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.JFrame;
......@@ -102,7 +102,7 @@ public class RealtimeChart01 implements ExampleChart {
private List<Double> getRandomData(int numPoints) {
List<Double> data = new ArrayList<Double>();
List<Double> data = new CopyOnWriteArrayList<Double>();
for (int i = 0; i < numPoints; i++) {
data.add(Math.random() * 100);
}
......
......@@ -15,10 +15,10 @@
*/
package com.xeiam.xchart.demo.charts.realtime;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.JFrame;
......@@ -105,7 +105,7 @@ public class RealtimeChart02 implements ExampleChart {
private List<Double> getRandomData(int numPoints) {
List<Double> data = new ArrayList<Double>();
List<Double> data = new CopyOnWriteArrayList<Double>();
for (int i = 0; i < numPoints; i++) {
data.add(Math.random() * 100);
}
......@@ -114,7 +114,7 @@ public class RealtimeChart02 implements ExampleChart {
private List<Integer> getMonotonicallyIncreasingData(int numPoints) {
List<Integer> data = new ArrayList<Integer>();
List<Integer> data = new CopyOnWriteArrayList<Integer>();
for (int i = 0; i < numPoints; i++) {
data.add(i);
}
......
......@@ -19,6 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.JFrame;
......@@ -37,9 +38,9 @@ import com.xeiam.xchart.demo.charts.ExampleChart;
*/
public class RealtimeChart03 implements ExampleChart {
private List<Integer> xData = new ArrayList<Integer>();
private List<Double> yData = new ArrayList<Double>();
private List<Double> errorBars = new ArrayList<Double>();
private List<Integer> xData = new CopyOnWriteArrayList<Integer>();
private List<Double> yData = new CopyOnWriteArrayList<Double>();
private List<Double> errorBars = new CopyOnWriteArrayList<Double>();
public static final String SERIES_NAME = "series1";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment