RFR: 8354990: Improve negative tests coverage for jpackage signing [v2]

Alexander Matveev almatvee at openjdk.org
Tue Apr 22 00:18:47 UTC 2025


On Tue, 22 Apr 2025 00:03:01 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSign.java line 410:
>> 
>>> 408:                         continue;
>>> 409:                     }
>>> 410:                     certs.add(cert);
>> 
>> Maybe:
>> 
>>                     try {
>>                         final X509Certificate cert = (X509Certificate)CERT_FACTORY.generateCertificate(in);
>>                         certs.add(cert);
>>                     } catch (Exception ex) {
>>                         TKit.trace("Failed to parse certificate data: " + ex);                        
>>                     }
>
> This will combine certificate creation and adding it to the list of certificates. If the latter fails, this is not a `Failed to parse certificate data` error.

I see. Agree.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24762#discussion_r2053136973


More information about the core-libs-dev mailing list