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

Brian Burkhalter bpb at openjdk.org
Mon Jun 5 15:47:10 UTC 2023


On Sun, 4 Jun 2023 13:42:02 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
>
> test/jdk/java/nio/file/Files/Links.java line 63:
> 
>> 61:             Files.deleteIfExists(pathTarget);
>> 62:         }
>> 63: 
> 
> I think it's confusing to have a test for sym links before testing if sym links are supported. I think it's okay to not include tests that target very specific cases like Windows "developer mode" but a test that the optional specific exception is thrown is okay, it just feels like it should be just one of the tests, rather than done before knowing the test can run, e.g. try this on a non-NTFS system and I assume createSymbolicLink will fail and cause the test to fail.

Logically I don't like the ordering either but without this happening first the error was not reproduced on the pre-PR code.

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

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


More information about the nio-dev mailing list