RFR: 8367284: (fs) Support current working directory target in SecureDirectoryStream.move

Alan Bateman alanb at openjdk.org
Mon Jan 12 12:56:31 UTC 2026


On Tue, 9 Sep 2025 23:04:41 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Change `java.nio.file.SecureDirectoryStream.move` so that, instead of throwing a `NullPointerException` if the `targetdir` parameter is `null`, it considers a non-absolute path passed via `targetpath` as being relative to the current working directory.

src/java.base/share/classes/java/nio/file/SecureDirectoryStream.java line 205:

> 203:      *          the name of the file to move
> 204:      * @param   targetdir
> 205:      *          the destination directory

The proposed spec looks okay I think you can add "can be null" to the `@param description to make it clear in the parameter description too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27178#discussion_r2682155386


More information about the nio-dev mailing list