RFR: 8361587: AssertionError in File.listFiles() when path is empty and -esa is enabled [v5]

Alan Bateman alanb at openjdk.org
Fri Jul 11 07:26:44 UTC 2025


On Thu, 10 Jul 2025 22:47:12 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Changes to address `File.listFiles` invoked on an empty path. This fixes an oversight in #22821.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8361587: Modify mkdirs() testing

src/java.base/unix/classes/java/io/UnixFileSystem.java line 120:

> 118:     public String resolve(String parent, String child) {
> 119:         if (child.isEmpty()) return parent;
> 120:         if (parent.isEmpty()) return child;

The changes to the mkdirs tests suggest this isn't right. Can you look to special casing the empty parent in the listFiles methods as that should fix the issue without the side effect that is being worked around by the newly added mkdirs tests.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26224#discussion_r2199890602


More information about the core-libs-dev mailing list