private boolean shouldSuppressWarnings()

in src/main/java/com/amazon/checkerframework/cryptopolicy/CryptoPolicyComplianceVisitor.java [167:188]


    private boolean shouldSuppressWarnings(final ExpressionTree tree, final String suppressedString) {
        final TreePath path = trees.getPath(this.root, tree);
        if (path != null) {
            final VariableTree var = TreeUtils.enclosingVariable(path);
            if (var != null && hasSuppresssCryptoAnnotation(TreeUtils.elementFromTree(var),
                                                            suppressedString)) {
                return true;
            }
            final MethodTree method = TreeUtils.enclosingMethod(path);
            if (method != null) {
                final Element elt = TreeUtils.elementFromTree(method);

                return hasSuppresssCryptoAnnotation(elt, suppressedString);
            }
            final ClassTree cls = TreeUtils.enclosingClass(path);
            if (cls != null) {
                final Element elt = TreeUtils.elementFromTree(cls);
                return hasSuppresssCryptoAnnotation(elt, suppressedString);
            }
        }
        return false;
    }