On Tue, 6 Sep 2022 23:17:55 GMT, Valerie Peng <[email protected]> wrote:
>> Sorry, I re-read and maybe the original check is better. If both `keySet`
>> and `allProviders` are empty, then empty is returned. According to the spec,
>> it should be null.
>>
>> I still don't think either of them can be null, but adding the `isEmpty`
>> check is probably wrong.
>
> Well, it depends on how you interpret an empty filter map. If an empty table
> is specified, I'd think it means no criteria is set and all providers can be
> returned as the comment above suggested.
> As this is a corner case, I am ok with reverting the isEmpty() check to keep
> the same behavior as before. However, I don't get which part of spec states
> about returning null for this case?
The spec for this method:
* @return all the installed providers that satisfy the selection
* criteria, or {@code null} if no such providers have been installed.
My understanding is that you should not return an empty array.
-------------
PR: https://git.openjdk.org/jdk/pull/10008