Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8208077 File.listRoots performance degradation
  3. JDK-8301125

Release Note: `File::listRoots` Changed to Return All Available Drives on Windows

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 21
    • 11.0.18.0.2-oracle, 11.0.19-oracle, 17.0.7-oracle, 20.0.1, 21
    • core-libs
    • Windows operating system

    • 10

        The behavior of the method `java.io.File.listRoots()` on Microsoft Windows has changed in this release so that the returned array includes a `File` object for all available disk drives. This differs from the behavior in JDK 10 to JDK 20, where this method filtered out disk drives that were not accessible or did not have media present. This change avoids performance issues observed in the previous releases and also ensures that the method is consistent with the root directories in the iteration returned by `FileSystem.getDefault().getRootDirectories()`.

              bpb Brian Burkhalter
              bpb Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: