On Mon, 29 Aug 2022 20:13:42 GMT, Valerie Peng <valer...@openjdk.org> wrote:

>> Existing provider filtering code only handles two standard attribute 
>> "KeySize" and "ImplementedIn", the rest are compared by exact match. Over 
>> time, more standard attributes are added which contain multiple values 
>> separated by "|". We should enhance the provider filtering code to better 
>> compare these.
>> 
>> Documentation update for this is tracked separately under 
>> https://bugs.openjdk.org/browse/JDK-6447817.
>> 
>> Thanks in advance for review~
>
> Valerie Peng has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   more refactoring.

src/java.base/share/classes/java/security/Security.java line 861:

> 859:             // check required values
> 860:             if (serviceName.isEmpty() || algName.isEmpty() ||
> 861:                     (!attrValue.isEmpty() && attrName.isEmpty())) {

Can we move the `attrName.isEmpty()` check inside the `else` block above? I 
find it easier to understand.

src/java.base/share/classes/java/security/Security.java line 864:

> 862:                 throw new InvalidParameterException("Invalid filter");
> 863:             }
> 864:         }

Add an empty line here.

src/java.base/share/classes/java/security/Security.java line 865:

> 863:             }
> 864:         }
> 865:         void apply(LinkedList<Provider> candidates) {

`candidates.removeIf(p -> !isCriterionSatisfied(p));`

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

PR: https://git.openjdk.org/jdk/pull/10008

Reply via email to