On Fri, 17 Jun 2022 17:01:10 GMT, Alexey Semenyuk <asemen...@openjdk.org> wrote:

>> Alexander Matveev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8287971: Throw exception for missing values in .jpackage.xml [v3]
>
> test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java line 
> 307:
> 
>> 305:         if (appImage == null) {
>> 306:             throw new RuntimeException("Error: --app-image expected");
>> 307:         }
> 
> Can be simplified to:
> 
> Path jpackageXMLFile = AppImageFile.getPathInAppImage(
>                 Optional.ofNullable(getArgumentValue("--app-image")).map(
>                         Path::of).orElseThrow(() -> {
>                             return new RuntimeException(
>                                     "Error: --app-image expected");
>                         }));
> 
> 
> And you don't need copy/paste code from `AppImageFile.getPathInAppImage()` 
> below.

Done. I also switched to use AppImageFile.getVersion() and 
AppImageFile.getPlatform().

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

PR: https://git.openjdk.org/jdk19/pull/9

Reply via email to