commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niall Pemberton <niall.pember...@gmail.com>
Subject Re: [io] LockableFileWriter.close() ignores exceptional return value of java.io.File.delete()
Date Thu, 08 Sep 2011 21:19:56 GMT
On Wed, Sep 7, 2011 at 1:26 PM, Gary Gregory <garydgregory@gmail.com> wrote:
> Should LockableFileWriter.close() be changed from:
>
>    public void close() throws IOException {
>        try {
>            out.close();
>        } finally {
>            lockFile.delete();
>        }
>
> to:
>
>    public boolean close() throws IOException {
>        try {
>            out.close();
>        } finally {
>            return lockFile.delete();
>        }
>
> ?

close() is overriden from java.io.Writer which has a return type of
void - so this is not possible.

Niall

>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: http://s.apache.org/rl
> Spring Batch in Action: http://s.apache.org/HOq
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

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


Mime
View raw message