RFR: 8020199: (fs) Files.move() throws DirectoryNotEmptyException pointing to wrong directory (win)

Brian Burkhalter bpb at openjdk.org
Wed Aug 9 18:23:28 UTC 2023


On Wed, 9 Aug 2023 16:28:42 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Yes, I think we should just close the issue, assuming the exception is clear.
>
> Thanks. I'll double check it on Windows 11 and then close these.

With JDK 18 and the current mainline the test case throws this exception, which is what one would expect:


java MoveTestcase
Exception in thread "main" java.nio.file.DirectoryNotEmptyException: c:\foobar
        at $ java.base/sun.nio.fs.WindowsFileCopy.ensureEmptyDir(WindowsFileCopy.java:276)
        at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:440)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:291)
        at java.base/java.nio.file.Files.move(Files.java:1430)
        at MoveTestcase.main(MoveTestcase.java:15)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15199#discussion_r1289002638


More information about the nio-dev mailing list