commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Vandahl (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (JCS-77) NullPointerException thrown by IndexedDiskCache if IndexedDisk calls fail to initialize
Date Sat, 04 Aug 2012 15:02:02 GMT

     [ https://issues.apache.org/jira/browse/JCS-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thomas Vandahl resolved JCS-77.
-------------------------------

       Resolution: Fixed
    Fix Version/s: jcs-1.4-dev
         Assignee: Thomas Vandahl  (was: Aaron Smuts)

Fixed in SVN trunk
                
> NullPointerException thrown by IndexedDiskCache if IndexedDisk calls fail to initialize
> ---------------------------------------------------------------------------------------
>
>                 Key: JCS-77
>                 URL: https://issues.apache.org/jira/browse/JCS-77
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: Indexed Disk Cache
>    Affects Versions: jcs-1.3, jcs-1.4-dev
>            Reporter: Matt Morrisson
>            Assignee: Thomas Vandahl
>            Priority: Minor
>             Fix For: jcs-1.4-dev
>
>
> 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
)
> >             {
> >                 // Kick off a real time optimization, in case we didn't do a final
optimization.
> >                 doOptimizeRealTime();
> >             }
> 214,219d220
> <         // TODO: Should we improve detection of whether or not the file should be
optimized.
> <         if ( isRealTimeOptimizationEnabled && keyHash.size() > 0 )
> <         {
> <             // Kick off a real time optimization, in case we didn't do a final optimization.
> <             doOptimizeRealTime();
> <         }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message