private List matchCiphersFromAnnotation()

in src/main/java/com/amazon/checkerframework/cryptopolicy/CryptoPolicyComplianceVisitor.java [125:146]


    private List<String> matchCiphersFromAnnotation(final List<String> regexList,
                                                    final List<String> stringList,
                                                    final boolean positive) {
        // if there are no valid whitelist items, don't continue
        if (regexList.isEmpty()) {
            return new ArrayList<>();
        }

        List<Boolean> valuesMatched =
            stringList.stream()
                      .map(value -> regexList.stream()
                                             .anyMatch(regex -> value.matches(regex.toLowerCase())))
                      .collect(Collectors.toList());

        final List<String> matchedCiphers = new ArrayList<>();
        for (int i = 0; i < valuesMatched.size(); i++) {
            if (valuesMatched.get(i) == positive) {
                matchedCiphers.add(stringList.get(i));
            }
        }
        return matchedCiphers;
    }