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 613: > 611: // For each selection criterion, remove providers > 612: // which don't satisfy the criterion from the candidate set. > 613: Iterator<Map.Entry<String, String>> iter = entries.iterator(); `for (var e : entries)` is simpler. Inside the loop, you can also directly return `null` is it's empty. Then there is no need to check for `isEmpty` again outside. src/java.base/share/classes/java/security/Security.java line 824: > 822: private String algName; > 823: private String attrName = null; > 824: private String attrValue; Make these `final`. ------------- PR: https://git.openjdk.org/jdk/pull/10008