RFR: 8304006: jlink should create the jimage file in the native endian for the target platform [v21]
Alan Bateman
alanb at openjdk.org
Sat Jul 15 06:20:26 UTC 2023
On Sat, 15 Jul 2023 00:47:35 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Hello Alan,
>>
>>> Files.isSameFile checks the file contents, this doesn't look right here.
>>
>> I was always under the impression that `Files.isSameFile()` only checks file paths and attributes for testing whether they are same. The API doc of `Files.isSameFile()` too don't mention about contents and looking at the implementation in `UnixFileSystemProvider` and `ZipFileSystemProvider` (for example), then don't seem to check the contents either. There's however a mention in the API doc of `Files.isSameFile()` which says:
>>
>>> and depending on the implementation, may require to open or access both files.
>>
>> So I'm guessing that, that's what allows `FileSystemProvider` implementations to actually check the content of the files.
>>
>> I'll change this to use `toRealPath()` as you noted.
>>
>>> Also, just to say that !Files.exists should be Files.notExists.
>>
>> I've overlooked Files.notExists. I'll update this as well.
>
> Done. The PR has been updated with these changes.
Apologies, I somehow had Files.mismatch in my head, which does compare contents. If the files exists, Files.isSameFile is semantically equivalent to checking if the real path to both is equal, so what you had on that file was correct.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/11943#discussion_r1264340368
More information about the core-libs-dev
mailing list