new File("symlink").list() returns null if link's target is a directory (win)

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • tbd
    • Affects Version/s: 25
    • Component/s: core-libs
    • None
    • generic
    • windows

      Given a directory with this content

      10/01/2025 04:37 PM <DIR> dir
      10/01/2025 04:41 PM <SYMLINKD> dirlink [dir]
      10/01/2025 04:41 PM <JUNCTION> junction [C:\Users\bpb\dev\bugs\dir]
      10/01/2025 04:41 PM <SYMLINK> symlink [dir]

      the File.list() method returns the contents of "dir" for the paths "dir", "dirlink", and "junction", but returns null for "symlink". The class level specification of File states

      "[...] operations on files that are symbolic links are automatically redirected to the target of the link."

      so either list[Files] needs to be changed to return the same a non-null array with the same contents for"symlink", or it needs to return null for all the above cases with an update to the method specifications to so indicate.

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

              Created:
              Updated:
              Resolved: