Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255576

(fs) Files.isHidden() throws ArrayIndexOutOfBoundsException (unix)

XMLWordPrintable

    • b23
    • generic
    • linux

      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

            cstein Christian Stein
            cstein Christian Stein
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: