RFR: 8307887: (fs) Files.createSymbolicLink throws less specific exception when in developer mode and file already exists [v2]

Brian Burkhalter bpb at openjdk.org
Fri Jun 2 16:32:39 UTC 2023


On Fri, 2 Jun 2023 05:46:20 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8307887: Move unprivileged link creation logic to WindowsLinkSupport
>
> src/java.base/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java line 994:
> 
>> 992:                     int lastError = y.lastError();
>> 993:                     if (lastError != ERROR_PRIVILEGE_NOT_HELD && lastError != ERROR_INVALID_PARAMETER)
>> 994:                         throw y;
> 
> The methods that WindowsNativeDispatcher defines are meant to be 1-1 mapping to win32 calls. It looks like we put the changes for JDK-8221852 in the wrong place, they need to be the usage rather than here.

Restored `WindowsNativeDispatcher` 1:1 mapping for `CreateSymbolcLink`: logic moved to a new static method in `WindowsLinkSupport` (255f5c7f8d86a3d653fb648ed993bb4589792881).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14255#discussion_r1214582203


More information about the nio-dev mailing list