[11.0.9u] RFR (XS) 8250787: Provider.put no longer registering aliases in FIPS env
Martin Balao
mbalao at redhat.com
Wed Sep 23 14:26:50 UTC 2020
On Tue, Sep 22, 2020 at 7:46 PM David Alvarez <alvdavi at amazon.com> wrote:
> Indeed, having a service registered twice is possible since the dual map
> was added. I've checked this behavior in the current version (add two
> services with the same algorithm, different class and then use
> Provider.put to add an alias).
>
> Requesting the algorithm will return the one that was registered with
> putService. Requesting the alias will also return the one registered
> with putService.
>
> However, some problems:
> - Enumerating all the services via getServices will return both services
> - The service registered with putService will have an empty aliases list
> - The service registered with put will have the registered alias in the
> aliases list
Thanks for investigating these cases.
>
> The fact that you can register two services with the same name is not
> what this patch is fixing, but we might make the behavior a bit more
> consistent if we make it so we look into the serviceMap before we look
> into the legacyMap when we add aliases. At least, that way the service
> that is returned when requesting the alias will have the aliases list
> populated.
>
> I've created an updated webrev with this version:
> http://cr.openjdk.java.net/~alvdavi/webrevs/8250787/webrev.11u.01/
>
Even if not critical, I agree that it's more consistent.
Webrev.01 looks good to me.
More information about the jdk-updates-dev
mailing list