Otherwise, DB may return disposed chart.
gitlab #86
public IJFreeChart perform(ReadGraph graph) throws DatabaseException {
// Adapt chartResource to a chart (XY, pie, bar, ...)
if(graph.isInstanceOf(chartResource, JFreeChartResource.getInstance(graph).Chart)) {
- return graph.adapt(chartResource, IJFreeChart.class);
+ return graph.adaptUnique(chartResource, IJFreeChart.class);
} else {
return null;
}
public IJFreeChart perform(ReadGraph graph) throws DatabaseException {
// Adapt chartResource to a chart (XY, pie, bar, ...)
if(graph.isInstanceOf(chartResource, JFreeChartResource.getInstance(graph).Chart)) {
- return graph.adapt(chartResource, IJFreeChart.class);
+ return graph.adaptUnique(chartResource, IJFreeChart.class);
} else {
return null;
}