RFR: 8346094: Harden X509CertImpl.getExtensionValue for NPE cases

Matthew Donovan mdonovan at openjdk.org
Thu Feb 6 14:05:11 UTC 2025


On Tue, 4 Feb 2025 04:51:15 GMT, Konanki Sreenath <duke at openjdk.org> wrote:

>> test/jdk/java/security/cert/X509Certificate/CertificateExtensions.java line 29:
>> 
>>> 27:          * else it is incorrect
>>> 28:          */
>>> 29:         try {
>> 
>> These try/catch blocks around the assert statements seem redundant. The assert methods already throw a RuntimeException with a message.
>
> Addressed and consolidated all try-catch blocks

Is this try/catch necessary at all? The methods in Asserts throw RuntimeExceptions already and the "test setup" code like createCertificateExceptions() throws other exceptions which is fine because main() is declared to throw Exception.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23315#discussion_r1944782038


More information about the security-dev mailing list