@Override public Void visitDeclared(AnnotatedDeclaredType type, ElementKind p) { Element elt = type.getElement(); if (!type.isAnnotated() && ( /*checker.isDefaultAnyType(type) ||*/ elt != null && ElementUtils.isStatic(elt) && (elt.getKind() == ElementKind.FIELD || elt.getKind() == ElementKind.LOCAL_VARIABLE || elt.getKind() == ElementKind.EXCEPTION_PARAMETER || elt.getKind() == ElementKind.ENUM_CONSTANT || elt.getKind() == ElementKind.PARAMETER))) { type.clearAnnotations(); Set<AnnotationMirror> set = AnnotationUtils.createAnnotationSet(); set.add(checker.ANY); if (elt != null && ElementUtils.isStatic(elt)) set.add(checker.PEER); annotateConstants(type, set); } return super.visitDeclared(type, p); }