Search in sources :

Example 1 with AnnotatedFor

use of org.checkerframework.framework.qual.AnnotatedFor in project checker-framework by typetools.

the class SourceChecker method isAnnotatedForThisCheckerOrUpstreamChecker.

private boolean isAnnotatedForThisCheckerOrUpstreamChecker(@Nullable Element elt) {
    if (elt == null || !useUncheckedCodeDefault("source")) {
        return false;
    }
    @Nullable AnnotatedFor anno = elt.getAnnotation(AnnotatedFor.class);
    String[] userAnnotatedFors = (anno == null ? null : anno.value());
    if (userAnnotatedFors != null) {
        List<String> upstreamCheckerNames = getUpstreamCheckerNames();
        for (String userAnnotatedFor : userAnnotatedFors) {
            if (CheckerMain.matchesCheckerOrSubcheckerFromList(userAnnotatedFor, upstreamCheckerNames)) {
                return true;
            }
        }
    }
    return false;
}
Also used : Nullable(org.checkerframework.checker.nullness.qual.Nullable) AnnotatedFor(org.checkerframework.framework.qual.AnnotatedFor)

Aggregations

Nullable (org.checkerframework.checker.nullness.qual.Nullable)1 AnnotatedFor (org.checkerframework.framework.qual.AnnotatedFor)1