8201407: Files.move throws DirectoryNonEmptyException when moving directory across file system

Brian Burkhalter brian.burkhalter at oracle.com
Fri May 25 00:30:19 UTC 2018


On May 13, 2018, at 12:52 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

>> http://cr.openjdk.java.net/~bpb/8201407/webrev.00/
>> 
>> If this looks like the correct thing to do, then I will file a CSR, develop an analogous Windows fix, and add tests.
>> 
> This subtly changes DirectoryNotEmptyException from an "optional specific exception" to a mandated exception. I think it would be better to just add to the existing @throws DirectoryNotEmptyException as the spec can't guarantee that you can throw this specific exception in all scenarios.
> 
> As regards whether to attempt to check for entries before creating the target directory then that seems worth exploring.

An updated version is at http://cr.openjdk.java.net/~bpb/8201407/webrev.01/.

Note that the test will still fail for different reasons when -Dtest.dir specifies a different device. This is tracked by [1].

Thanks,

Brian

[1] https://bugs.openjdk.java.net/browse/JDK-8203803
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20180524/58dac607/attachment.html>


More information about the nio-dev mailing list