use of com.facebook.buck.util.liteinfersupport.Nullable in project buck by facebook.
the class TreeContextScanner method scan.
@Override
@Nullable
public R scan(Tree tree, @Nullable P p) {
if (tree == null) {
return null;
}
TreePath previousPath = currentPath;
Element previousEnclosingElement = enclosingElement;
currentPath = new TreePath(currentPath, tree);
switch(tree.getKind()) {
case ANNOTATION_TYPE:
case CLASS:
case COMPILATION_UNIT:
case ENUM:
case INTERFACE:
case METHOD:
case VARIABLE:
case TYPE_PARAMETER:
enclosingElement = Preconditions.checkNotNull(trees.getElement(currentPath));
break;
// $CASES-OMITTED$
default:
break;
}
try {
// This super call will actually visit the tree, now with all the context set up
return super.scan(tree, p);
} finally {
currentPath = previousPath;
enclosingElement = previousEnclosingElement;
}
}
use of com.facebook.buck.util.liteinfersupport.Nullable in project buck by facebook.
the class TreeResolver method getType.
@Nullable
public TypeMirror getType(TreePath path) {
Tree tree = path.getLeaf();
TypeMirror result = treesToTypes.get(tree);
if (result != null) {
return result;
}
treesToTypes.put(tree, resolveType(path));
return treesToTypes.get(tree);
}
Aggregations