EHC ❯ Unable to persist to DiskStore when Collections contain null
-
Bug
-
Status: Closed
-
-
Resolution: Fixed
-
-
-
drb
-
Reporter: sourceforgetracker
-
September 21, 2009
-
0
-
Watchers: 0
-
September 22, 2009
-
September 22, 2009
Description
Version : ehcache-1.4.1
I was wondering why my caches we not flushed to disk and found out that my Cache Elements contained Collections with null values which are not considered as Serializable by EHCache …
In Element.java:498 : public final boolean isSerializable() { return key instanceof Serializable && value instanceof Serializable; }
The problem is that null instanceof Serializable returns false although null can be serialized.
I changed that to :
public final boolean isSerializable() {
return key instanceof Serializable && ((value == null) || (value instanceof Serializable));
}
And it works fine now. Sourceforge Ticket ID: 2026586 - Opened By: balb - 24 Jul 2008 09:38 UTC
Re-opening so that I can properly close out these issues and have correct Resolution status in Jira