On Thu, 19 Aug 2021 23:56:00 GMT, Calvin Cheung <cche...@openjdk.org> wrote:

>> src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java 
>> line 89:
>> 
>>> 87:         private final List<String> args;
>>> 88:         private final Set<String> modules;
>>> 89:         private Platform platform;
>> 
>> Can `DefaultExecutableImage` constructor take an additional `platform` 
>> argument and make this `platform` field final?
>> 
>> When the `DefaultExecutableImage` is constructed, it already has the target 
>> platform information.
>> 
>> In the constructor, it can check if the `platform` parameter must not be 
>> `UNKNOWN`; otherwise throw IAE.
>
> I've added the `platform` argument and made the `platform` field final.
> However, as we've discussed offline, there's a code path via the 
> `--post-process-path` option where the platform may not be available. So we 
> can't throw IAE on an `UNKNOWN` platform in the constructor.

Since `--post-process-path` is a hidden option, it's fine not to support it.

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

PR: https://git.openjdk.java.net/jdk/pull/5174

Reply via email to