RFR: 8357404: jpackage should attempt to get a package version from the JDK's release file if the --version option is not specified [v9]
Alexey Semenyuk
asemenyuk at openjdk.org
Tue Feb 10 01:22:37 UTC 2026
On Tue, 10 Feb 2026 01:02:40 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:
>> src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacFromOptions.java line 367:
>>
>>> 365: return ver.toComponentsString();
>>> 366: }
>>> 367: }
>>
>> Why branching?
>>
>> It can be as simple as:
>>
>> DottedVersion.lazy(version).trim(3).pad(3).toComponentsString()
>>
>>
>> The same comment applies to other locations where `trim()` and `pad()` are used.
>
> 1, 2 and 3 components are valid for macOS. I do not see a point to normalized valid versions. For example if we packaging JDK 27, then file name will be myJDK-27.dmg, but if we normalize to 3 components always it will be myJDK-27.0.0.dmg.
Ok, then it should be no padding, only trimming:
DottedVersion.lazy(version).trim(3).toComponentsString()
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2785312227
More information about the core-libs-dev
mailing list