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

Martin Balao mbalao at openjdk.org
Thu Apr 3 00:46:51 UTC 2025


On Thu, 6 Mar 2025 06:13:22 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 1502:
> 
>> 1500:                 return parseLegacy(servicesMap, ks, vs, opType);
>> 1501:             } else if (value != null && oldValue instanceof String oldValueS &&
>> 1502:                     opType == OPType.ADD) {
> 
> Which method is this else-block for? `value` is not null and not instanceof `String` and `oldValue` is instanceof `String` and `opType` is ADD?

In this case we are adding an entry to the Provider (seen as a Properties map more than a Provider). The value of this new entry is not a string and is replacing an entry with the same key, whose value is mapped to a service in the internal (services) map. From the point of view of the internal map, this acts as a removal.

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

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


More information about the security-dev mailing list