RFR: 8345139: Fix bugs and inconsistencies in the Provider services map [v5]

Martin Balao mbalao at openjdk.org
Wed Apr 2 16:47:51 UTC 2025


On Tue, 25 Feb 2025 19:40:24 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Francisco Ferrari Bihurriet has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Clear ServicesMap fields in the declared order
>>   
>>   Constructors assign the fields in the same order.
>
> src/java.base/share/classes/java/security/Provider.java line 2158:
> 
>> 2156:             hasKeyAttributes = null;
>> 2157:             supportedFormats = null;
>> 2158:             supportedClasses = null;
> 
> Are these necessary? The other constructor didn't set them.

We made these fields initialization explicit in the copy-constructor to document that cached fields need to be regenerated, and it's not that we forgot (or were added later). That's why we added the comment in the lines before.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22613#discussion_r2025222786


More information about the security-dev mailing list