jfree/jfreechart-fse

synchronization issue during rendering in XYPlot

Opened this issue · 1 comments

The way the series with its XYDataItem are rendered inside the XYPlot:render, may lead to that an IndexOutOfBoundsException is throws. The reason for this is that it's possible to remove items during the render method is executing. synchronization for the code that either gets or removes from the List data in XYSeries are therefore suitable.

The impact of this problem is that an IndexOutOfBoundsException is thrown without being caught. For my application, this means occational stacktraces printed out in the console and the chart isn't rendered properly.

jfree commented

JFreeChart isn't thread-safe, so you need to ensure that datasets are updated on the same thread as the rendering...in other words, the Event Dispatch Thread (EDT). It is the same as when updating data models in Swing.