RFR: 8317128: java/nio/file/Files/CopyAndMove.java failed with AccessDeniedException
Brian Burkhalter
bpb at openjdk.org
Fri Sep 29 16:54:23 UTC 2023
The change #15501 removed explicit throwing of a `FileAlreadyExistsException` in `copyToForeignTarget` for non-directories when the target exists and `REPLACE_EXISTING` is not specified, instead relying on `FileChannel.open` eventually to throw this exception. The test, however, reuses the same file path, and on Windows `CreateFile`, which is invoked by `open`, can throw an `AccessDeniedException` if the file exists and has been marked for deletion but not yet actually deleted. This change proposes to reinstate explicitly throwing a FAEE.
-------------
Commit messages:
- 8317128: java/nio/file/Files/CopyAndMove.java failed with AccessDeniedException
Changes: https://git.openjdk.org/jdk/pull/15991/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15991&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8317128
Stats: 10 lines in 2 files changed: 6 ins; 2 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/15991.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/15991/head:pull/15991
PR: https://git.openjdk.org/jdk/pull/15991
More information about the nio-dev
mailing list