RFR: 8255576: (fs) Files.isHidden() throws ArrayIndexOutOfBoundsException (unix)

Alan Bateman alanb at openjdk.java.net
Fri Oct 30 18:09:54 UTC 2020


On Fri, 30 Oct 2020 08:56:21 GMT, Christian Stein <cstein at openjdk.org> wrote:

> This PR fixes a corner case of `Files.isHidden(Path)` where
> the given path is an empty path: `Path.of("")`.

test/jdk/java/nio/file/Files/Misc.java line 96:

> 94:             throw new AssertionError("8255576", exception);
> 95:         }
> 96: 

Thanks for taking this one. The implementation changes are good.

For the test then I don't think we need to catch AIOOB, the test should fail if any exception is thrown. I think think of any scenario where it would be sensible to run the tests when in a hidden directory so we could change this to test that isHidden returns false - do you agree?

-------------

PR: https://git.openjdk.java.net/jdk/pull/952


More information about the nio-dev mailing list