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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7, 16
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b23
    • CPU:
      generic
    • OS:
      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: