On Wed, 4 Feb 2026 00:25:16 GMT, Alexander Matveev <[email protected]> wrote:

>> src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/RuntimeImageUtils.java
>>  line 47:
>> 
>>> 45:         }
>>> 46: 
>>> 47:         return releaseFile;
>> 
>> Why do we need platform-specificity in this function?
>> 
>> Shouldn't it be as simple as:
>> 
>> public static Path getReleaseFilePath(Path runtimePath) {
>>     return runtimePath.resolve("release");
>> }
>
> This function is being called 3 times already. I think having platform 
> specific code in it is better, then duplicating:
> 
> RuntimeImageUtils.getReleaseFilePath(MacBundle.fromPath(cookedRuntime).map(MacBundle::homeDir).orElse(cookedRuntime));
> 
> I do like idea of using `MacBundle.fromPath()`.

The code that finds the JDK image directory in a random path is a separate 
function.
The function that returns a path to the "release" file in the JDK image should 
take a path to the JDK image directory.

If we need a convenience function that does both things, we should implement it 
on top of these two functions.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2762031458

Reply via email to