RFR: 8373710: Improve jpackage error reporting [v3]

Alexey Semenyuk asemenyuk at openjdk.org
Tue Dec 16 23:36:16 UTC 2025


On Tue, 16 Dec 2025 22:43:13 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:

>> Alexey Semenyuk has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix test failure; Fix whitespaces
>
> src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java line 152:
> 
>> 150:                 var errMsg = I18N.format("error.cert.not.found", certificateSelector.signingIdentities().getFirst(),
>> 151:                         keychain.map(Keychain::name).orElse(""));
>> 152:                 Log.error(I18N.format("message.error-header", errMsg));
> 
> Looks like it is only place which uses `message.error-header` directly. Do you know why?

This is because ErrorTest expects two error messages when a certificate cannot be found [1].
One is `error.cert.not.found`, and another one is `error.explicit-sign-no-cert`. 
It has been like this all the time.

Test cases for these keys were added in [JDK-8355328](https://bugs.openjdk.org/browse/JDK-8355328). Back in the day, these errors were reported from different locations. When `SigningIdentityBuilder.java` was added, the same function started reporting both errors.

We can report only a single exception to the top-level error handler. So one error is reported in place, and another is reported with an exception.

I can see now that `error.cert.not.found`, and `error.explicit-sign-no-cert` are duplicating each other. We need only one of them. I filed [JDK-83738330](https://bugs.openjdk.org/browse/JDK-83738330) to do this follow-up clean-up.

[1] https://github.com/openjdk/jdk/blob/87d881fee01c42f5847031a63d50873b3d438f7a/test/jdk/tools/jpackage/share/ErrorTest.java#L703

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28833#discussion_r2625089412


More information about the core-libs-dev mailing list