Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
jcs-1.3, jcs-2.0-beta-1
-
None
Description
In the constructor for IndexedDiskCache.java, if an exception is thrown while creating dataFile or keyFile, the keyHash member variable is never initialized, the if check after the catch block will throw an NPE when keyHash.size() is called.
I am experiencing this in 1.3, and it looks like it would still occur in 1.4.
One solution for 1.3 might be to move the doOptimizeRealTime() check inside the catch block:
IndexedDiskCache.java
206a207,213
>
> // TODO: Should we improve detection of whether or not the file should be optimized.
> if ( isRealTimeOptimizationEnabled && keyHash.size() > 0 )
>
214,219d220
< // TODO: Should we improve detection of whether or not the file should be optimized.
< if ( isRealTimeOptimizationEnabled && keyHash.size() > 0 )
<