tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@betaversion.org>
Subject Re: [t4 patch] delete the damn file. :-)
Date Fri, 22 Jun 2001 19:43:51 GMT
Quoting Jon Stevens <jon@latchkey.com>:

> Untested...
> 
> If there is an exception thrown during the processing, the file won't
> get
> deleted because it isn't in a try/finally statement...

That looks like a good idea (more robust).

I would add the finally block to the second try (the one in the sync(sessions) 
block) (apparently, if the first one is failing, it's only because no file 
exists).

Remy

> cvs diff StandardManager.java
> Index: StandardManager.java
> ===================================================================
> RCS file: 
> /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/se
> ssion/StandardManager.java,v
> retrieving revision 1.10
> diff -r1.10 StandardManager.java
> 353a354,355
> >         try {
> >
> 445,447c447,451
> <         // Delete the persistent storage file
> <         file.delete();
> <
> ---
> >         } finally {
> >             // Delete the persistent storage file
> >             if (file != null && file.exists() )
> >                 file.delete();
> >         }
> 

Mime
View raw message