RFR: 8368030: Make package bundlers stateless
Alexey Semenyuk
asemenyuk at openjdk.org
Thu Sep 25 19:20:27 UTC 2025
On Thu, 25 Sep 2025 19:11:22 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:
>> This code is copied from [LinuxDebBundler.java#L108](https://github.com/openjdk/jdk/blame/569e78080b3c25c95d85e9e194626f95f86b9b10/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java#L108).
>>
>> `Path.equals()` will always return `true` as two Path objects reference the same file. The test must compare path strings, not that two Path objects reference the same file (which they do). That is why `String.equals()` is used.
>
> According to docs `Path.equals()` does not follow symbolic link, unless I miss read something. `isSameFile()` will return true if two paths reference the same file.
A quote from https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/file/Path.html#equals(java.lang.Object):
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27377#discussion_r2380098809
More information about the core-libs-dev
mailing list