RFR: 8059269 - FileHandler may throw NPE if pattern is a simple name and the lock file already exists

Alan Bateman Alan.Bateman at oracle.com
Mon Sep 29 13:12:04 UTC 2014


On 29/09/2014 13:53, Daniel Fuchs wrote:
>
> Do you mean that calling delete() will not close the file?
That's right.

>
> :
>
> - 233   FileChannel.open(Paths.get(file + ".lck"), CREATE_NEW, WRITE);
> - 234   FileChannel.open(Paths.get(file + ".1.lck"), CREATE_NEW, WRITE);
> + 233   FileChannel.open(Paths.get(file + ".lck"), CREATE_NEW, WRITE)
>            .close();
> + 234  FileChannel.open(Paths.get(file + ".1.lck"), CREATE_NEW, WRITE)
>            .close();
>
> http://cr.openjdk.java.net/~dfuchs/webrev_8059269/webrev.01
That is okay, alternatively just use Files.createFile.

-Alan



More information about the core-libs-dev mailing list