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

Martin Balao mbalao at openjdk.org
Thu Apr 3 00:38:50 UTC 2025


On Wed, 5 Mar 2025 07:06:45 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 1374:
> 
>> 1372:                 ServiceUpdateCallback updateCb) {
>> 1373:             Service newSvc;
>> 1374:             MappingInfo oldMi = find(key);
> 
> `oldMi` could just simply be `mi`? There is no `newMi` in the same method anywhere.

We used `old` to stress the difference with the new service that is added to replace the old one. For example, in the statement `newSvc = new Service(oldMi.svc)` we see more clearly the contrast. There isn't a `newMi` because we don't look up in the map again. Unless you have a strong preference, I'd stick with `old`. Let us know.

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

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


More information about the security-dev mailing list