On Thu, 10 Jun 2021 18:10:37 GMT, Sean Mullan <mul...@openjdk.org> wrote:

> I think it would be worthwhile to see if we can take this a step further, and 
> leverage the `Constraint` objects that are already created and stored in the 
> `Constraints` object in a `HashMap<String, List<Constraint>>`. The key is the 
> algorithm `String`, and the value is a `List` of `Constraint` objects that 
> apply to it. If the algorithm is completely disabled, the `List` would 
> contain one entry `Constraint.DisabledConstraint` (which has a `permits` 
> method that always returns `false`).
> 
> This way we could potentially eliminate the List/Set cache entirely and just 
> use the HashMap to check if the algorithm is disabled.

Thanks for the suggestion, `Constraints` is a private inner class in 
`DisabledAlgorithmConstraints.java` and cannot be accessed in 
`AbstractAlgorithmConstraints.java:checkAlgorithm`. 
Moreover, this method does not seem to be applicable to class 
`LegacyAlgorithmConstraints.java`, because there is no `Constraints` object in 
it.

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

PR: https://git.openjdk.java.net/jdk/pull/4424

Reply via email to