On Thu, 15 Jan 2026 02:36:49 GMT, Alexander Matveev <[email protected]>
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