@Override public Void visitVariable(VariableTree node, AnnotatedTypeMirror p) { typeAnnotator.visit(p); VariableElement varElt = TreeUtils.elementFromDeclaration((VariableTree) node); if (!p.isAnnotated() && ElementUtils.isStatic(varElt)) { p.clearAnnotations(); Set<AnnotationMirror> set = AnnotationUtils.createAnnotationSet(); set.add(checker.ANY); set.add(checker.PEER); annotateConstants(p, set); } return super.visitVariable(node, p); }
@Override public Void visitLiteral(LiteralTree tree, AnnotatedTypeMirror type) { if (!type.isAnnotated()) { // if (type.getKind() == TypeKind.NULL) { type.clearAnnotations(); Set<AnnotationMirror> set = AnnotationUtils.createAnnotationSet(); set.add(checker.BOTTOM); annotateConstants(type, set); // } // else // type.addAnnotation(checker.READONLY); } return super.visitLiteral(tree, type); }
private void annotateThis(AnnotatedTypeMirror type) { if (checker.isChecking()) return; type.clearAnnotations(); type.addAnnotation(checker.SELF); }