RFR: 8357404: jpackage should attempt to get a package version from the JDK's release file if the --version option is not specified [v10]
Alexey Semenyuk
asemenyuk at openjdk.org
Thu Feb 12 19:42:14 UTC 2026
On Wed, 11 Feb 2026 20:12:19 GMT, Alexander Matveev <almatvee at openjdk.org> 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 [v9]
test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java line 254:
> 252: return TKit.isLinux() && (PackageType.LINUX_RPM == getArgumentValue("--type",
> 253: () -> null, PACKAGE_TYPES::get));
> 254: }
This method is redundant. It can be replaced by `packageType() == PackageType.LINUX_RPM` condition
test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java line 263:
> 261: final var releaseFile = RuntimeImageUtils.getReleaseFilePath(runtimeHome);
> 262: return RuntimeVersionReader.readVersion(releaseFile).map(releaseVersion -> {
> 263: if (TKit.isWindows()) {
The switch would be more appropriate here:
switch (packageType()) {
case WIN_EXE, WIN_MSI -> {
return WindowsHelper.getNormalizedVersion(releaseVersion.toString());
}
...
}
test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java line 45:
> 43: import java.lang.reflect.InvocationTargetException;
> 44: import java.lang.reflect.Method;
> 45: import java.math.BigInteger;
This import looks redundant
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2800716263
PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2800721777
PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2800724898
More information about the core-libs-dev
mailing list