RFR: 8189953: FileHandler constructor throws NoSuchFileException with absolute path

mandy chung mandy.chung at oracle.com
Thu Nov 9 17:41:02 UTC 2017


Hi Daniel,

On 11/2/17 9:47 AM, Daniel Fuchs wrote:
> Hi,
>
> Please find below a patch for:
> 8189953: FileHandler constructor throws NoSuchFileException
>          with absolute path
> https://bugs.openjdk.java.net/browse/JDK-8189953
>
> webrev:
> http://cr.openjdk.java.net/~dfuchs/webrev_8189953/webrev.00/
>
This looks okay.

A minor comment: I think line 695-709 can be made cleaner and easier to 
read and

e.g.

if (word.length() >0) {
     String n = word.toString();
     if (result ==null) {
         result = prev !=null ? prev.resolveSibling(n) : Paths.get(n);
     }else {
         Path p = prev !=null ? prev.resolveSibling(n) : Paths.get(n);
         result = result.resolve(p);
     }
}else if (result ==null) {
     result = Paths.get("");
}
if (path.getRoot() ==null)
     return result.toFile();
else return path.getRoot().resolve(result).toFile();


Mandy


More information about the core-libs-dev mailing list