-
Notifications
You must be signed in to change notification settings - Fork 260
Description
In version 3.6.0 ReentrantReadWriteLock objects where added to the Zone class.
These ReentrantReadWriteLock objects are final and transient at the same time which is root cause of the problem.
Please keep in mind when an objects gets deserialized the consturctor are never called.
When an object was deserialized all fields of this class where setup to the serialized values when not marked as transient.
transient fields are setup to there default values. In this case to a null pointer.
And because these three ReentrantReadWriteLock fields are also marked as final there is no way to change the null pointer later.
So you end up with a NullPoinetrException.
When I look at the class ReentrantReadWriteLock I see that the class also implements Serializable.
So my proposal is simply to drop transient on these three fields.
In my test it works and the Zone object where successfuly deserialized.