RFR: 8374215: [macos] Clean and fix "lic_template.plist" to correctly work with multiple languages [v6]

Alexey Semenyuk asemenyuk at openjdk.org
Thu Jan 15 02:49:53 UTC 2026


On Thu, 15 Jan 2026 02:36:49 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:

>> src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgPackager.java line 190:
>> 
>>> 188:         if (pkg.licenseFile().isPresent()) {
>>> 189:             MacDmgLicense.prepareLicensePListFile(pkg.licenseFile().get(), licensePListFile());
>>> 190:         }
>> 
>> Isn't the following easier to read?
>> 
>> pkg.licenseFile().ifPresent(licenseFile -> {
>>     MacDmgLicense.prepareLicensePListFile(licenseFile, licensePListFile());
>> });
>
> We should catch exception, so not sure if it is easy to read. I do not have exact opinion on this one. If you think it is better to use `ifPresent` I will change it.
> 
> pkg.licenseFile().ifPresent(licenseFile -> {
>             try {
>                 MacDmgLicense.prepareLicensePListFile(licenseFile, licensePListFile());
>             } catch (IOException ex) {
>                 throw new UncheckedIOException(ex);
>             }
>         });

Ah, right, that checked exception. Scratch it then

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28959#discussion_r2692776928


More information about the core-libs-dev mailing list