On Tue, 25 Feb 2025 19:45:47 GMT, Valerie Peng <valer...@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 2149: > >> 2147: attributes = new HashMap<>(svc.attributes); >> 2148: } >> 2149: registered = false; > > I didn't see it's set to `true` in any of the constructors; also the default > value is already `false`, why only explicitly set it to `false` here? The value in this case could have been `true` as this constructor is only used when doing a copy-on-write from a service that is registered already in the map (the new/updated service will be in the map as well). We preferred to do this at the caller level. We can remove this explicit assignment from here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22613#discussion_r2025247755