Details
-
Bug
-
Resolution: Fixed
-
P4
-
7, 16
-
b23
-
generic
-
linux
Description
Running JShell 16-ea on Linux and passing an empty Path to Files.isHidden() throws an ArrayIndexOutOfBoundsException:
jshell> Files.isHidden(Path.of(""))
| Exception java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
| at UnixFileSystemProvider.isHidden(UnixFileSystemProvider.java:355)
| at Files.isHidden (Files.java:1637)
| at (#30:1)
Using an empty Path on Windows returns a value without throwing an exception:
jshell> Files.isHidden(Path.of(""))
$1 ==> false
jshell> Files.isHidden(Path.of(""))
| Exception java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
| at UnixFileSystemProvider.isHidden(UnixFileSystemProvider.java:355)
| at Files.isHidden (Files.java:1637)
| at (#30:1)
Using an empty Path on Windows returns a value without throwing an exception:
jshell> Files.isHidden(Path.of(""))
$1 ==> false