You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/01/31 02:10:38 UTC

DO NOT REPLY [Bug 48643] catalina.session.FileStore.save() and load() - close() bugs

https://issues.apache.org/bugzilla/show_bug.cgi?id=48643

--- Comment #1 from Sebb <se...@apache.org> 2010-01-30 17:10:36 UTC ---
There are similar problems in session.StandardManager.doUnload():

line 502, 530, and at line 542 there's a block of code:

// Flush and close the output stream
try {
    oos.flush();
    oos.close();
    oos = null;
} catch (IOException e) {
    if (oos != null) {
        try {
            oos.close();
        } catch (IOException f) {
            // Ignore
        }
        oos = null;
    }
    throw e;
}

This code looks as though it is trying to close() oos if the flush() fails, but
it will also try to close() oos if the close() fails.

Probably the first oos.close() should be removed. 
AFAICT, there is also no need to set the oos field to null.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org