@Override public Void visitLiteral(LiteralTree tree, AnnotatedTypeMirror type) { if (!type.isAnnotatedInHierarchy(LOCALIZED)) { if (tree.getKind() == Tree.Kind.STRING_LITERAL && tree.getValue().equals("")) { type.addAnnotation(LOCALIZED); } } return super.visitLiteral(tree, type); }
@Override public Void visitLiteral(LiteralTree tree, AnnotatedTypeMirror type) { if (!type.isAnnotatedInHierarchy(theAnnot) && tree.getKind() == Tree.Kind.STRING_LITERAL && strContains(lookupKeys, tree.getValue().toString())) { type.addAnnotation(theAnnot); } // A possible extension is to record all the keys that have been used and // in the end output a list of keys that were not used in the program, // possibly pointing to the opposite problem, keys that were supposed to // be used somewhere, but have not been, maybe because of copy-and-paste errors. return super.visitLiteral(tree, type); }