The class de.laures.cewolf.taglib.AbstractChartDefinition implements the Serializable Interface. However, it has two fields marked as transient which should not be transient, namely 'postProcessors' and 'chart'.
These fields may be uninitialized after deserialization but are not checked before use which may lead to a NullPointerException!
The 'chart' field is of type JFreeChart which is serializable thus removing the transient-keyword should be enough.
The 'postProcessors' fields is a list of ChartPostProcessors which need not to be serializable which is a problem. I can't see an easy way of solving this problem without touching other classes as well. My workaround is to check before every access so that no NPE is thrown and immediately return null. The caller has to check the result and handle this.
Log in to post a comment.