On Sun, 18 Jan 2026 05:17:40 GMT, Alexander Matveev <[email protected]>
wrote:
>> - Version will be read from JDK's release file if not provided via
>> `--version` for runtime installer.
>> - Added test to cover added functionality.
>> - On macOS and Windows version from JDK's release file will be normalized if
>> it does not fit platform requirements.
>
> Alexander Matveev has updated the pull request incrementally with one
> additional commit since the last revision:
>
> 8357404: jpackage should attempt to get a package version from the JDK's
> release file if the --version option is not specified [v6]
src/jdk.jpackage/share/classes/jdk/jpackage/internal/model/DottedVersion.java
line 227:
> 225: }
> 226:
> 227: public String toComponentsStringWithPadding(int numberOfComponents) {
The method's name is misleading, as the implementation may trim the components.
It also duplicates the functionality of the `toComponentsString()`. I suggest
splitting it into two methods: `DottedVersion trim(int componentLimit)` and
`DottedVersion pad(int componentLimit)`.
If they want to get a string representation of exactly 3 version components
they would call:
ver.trim(3).pad(3).toComponentsString();
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2755914569