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

Alexey Semenyuk asemenyuk at openjdk.org
Thu Jan 15 02:27:45 UTC 2026


On Thu, 15 Jan 2026 01:50:53 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:

>> src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgLicense.java line 43:
>> 
>>> 41: final class MacDmgLicense {
>>> 42: 
>>> 43:     public static void prepareLicense(MacDmgPackage pkg, BuildEnv env,
>> 
>> It is hard to tell from the method's signature what its inputs and outputs are. It is only clear that it somehow prepares the license. Sometimes it does not, but this becomes clear only after reading the code.
>> 
>> The `env` parameter is only used to create an `OveridableResource` instance.
>> 
>> That said, I suggest changing the signature to:
>> 
>> public static void prepareLicense(Path inputLicenseFile, Path outputLicenseFile) throws IOException;
>> 
>> 
>> And in the body replace 
>> 
>> env.createResource(DEFAULT_LICENSE_PLIST)
>> ``` 
>> with 
>> 
>> new OverridableResource(DEFAULT_LICENSE_PLIST, ResourceLocator.class)
>> 
>> 
>> If the package is configured without the license, `MacDmgLicense.prepareLicense()` should not be called.
>
> How about: `public static void prepareLicensePListFile(Path licenseFile, Path licensePListFile) throws IOException;`
> It creates PList file from input license. Also, I will rename `licenseFile()` to `licensePListFile()`, otherwise proposed call will look like `MacDmgLicense.prepareLicense(pkg.licenseFile(), licenseFile());` vs `MacDmgLicense.prepareLicensePListFile(pkg.licenseFile(), licensePListFile());`.

Agreed!

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

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


More information about the core-libs-dev mailing list