/** Scan a single node. The current path is updated for the duration of the scan. */ @Override public Void scan(Tree tree, VisitorState state) { if (tree == null) { return null; } SuppressionInfo prevSuppressionInfo = updateSuppressions(tree, state); try { return super.scan(tree, state); } finally { // Restore old suppression state. currentSuppressions = prevSuppressionInfo; } }
/** Scan a tree from a position identified by a TreePath. */ @Override public Void scan(TreePath path, VisitorState state) { SuppressionInfo prevSuppressionInfo = updateSuppressions(path.getLeaf(), state); try { return super.scan(path, state); } finally { // Restore old suppression state. currentSuppressions = prevSuppressionInfo; } }
@Override public Void scan(Tree tree, SymbolSink sink) { if (!sink.keepScanning()) { return null; } if (tree == null) { return null; } scanJavadoc(sink); return super.scan(tree, sink); }
@Override public Optional<TreePath> scan(Iterable<? extends Tree> nodes, Void v) { Optional<TreePath> ret = super.scan(nodes, v); return (ret != null) ? ret : Optional.<TreePath>absent(); }
@Override public Optional<TreePath> scan(Iterable<? extends Tree> nodes, Void v) { Optional<TreePath> ret = super.scan(nodes, v); return (ret != null) ? ret : Optional.<TreePath>absent(); }
@Override public Optional<TreePath> scan(Iterable<? extends Tree> nodes, Void v) { Optional<TreePath> ret = super.scan(nodes, v); return (ret != null) ? ret : Optional.<TreePath>absent(); }
/** @inheritDoc */ public R scan(Tree tree, P p) { if (isCanceled()) return null; return super.scan(tree, p); }
/** @inheritDoc */ public R scan(Iterable<? extends Tree> trees, P p) { if (isCanceled()) return null; return super.scan(trees, p); }
/** Scan a single node. The current path is updated for the duration of the scan. */ @Override public Void scan(Tree tree, VisitorState state) { if (tree == null) { return null; } SuppressionHelper.SuppressionInfo prevSuppressionInfo = updateSuppressions(tree, state); try { return super.scan(tree, state); } finally { // Restore old suppression state. suppressions = prevSuppressionInfo.suppressWarningsStrings; customSuppressions = prevSuppressionInfo.customSuppressions; inGeneratedCode = prevSuppressionInfo.inGeneratedCode; } }
@Override public Optional<TreePath> scan(Tree node, Void v) { if (node == null) { return Optional.<TreePath>absent(); } return isMatch(node, Optional.absent()) ? currentPathPlus(node) : absentIfNull(super.scan(node, v)); }
@Override public Optional<TreePath> scan(Tree node, Void v) { if (node == null) { return Optional.<TreePath>absent(); } return isMatch(node, Optional.absent()) ? currentPathPlus(node) : absentIfNull(super.scan(node, v)); }
@Override public Void scan(Tree tree, SymbolSink sink) { if (!sink.keepScanning()) { return null; } if (tree == null) { return null; } scanJavadoc(sink); return super.scan(tree, sink); }
@Override public Optional<TreePath> scan(Tree node, Void v) { if (node == null) { return Optional.<TreePath>absent(); } return isMatch(node, Optional.absent()) ? currentPathPlus(node) : absentIfNull(super.scan(node, v)); }
/** Scan a tree from a position identified by a TreePath. */ @Override public Void scan(TreePath path, VisitorState state) { SuppressionHelper.SuppressionInfo prevSuppressionInfo = updateSuppressions(path.getLeaf(), state); try { return super.scan(path, state); } finally { // Restore old suppression state. suppressions = prevSuppressionInfo.suppressWarningsStrings; customSuppressions = prevSuppressionInfo.customSuppressions; inGeneratedCode = prevSuppressionInfo.inGeneratedCode; } }
@Override @CheckForNull public Void scan(@NonNull final Tree node, @NonNull final Map<Pair<BinaryName,String>, UsagesData<String>> p) { if (node == null) { return null; } super.scan (node,p); return null; }
private static TypeElement getToplevelClass(final CompilationController controller) throws IOException { // Controller has to be in some advanced phase, otherwise controller.getCompilationUnit() == null if (controller.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) { return null; } TreePathScanner<TypeElement, Void> scanner = new TreePathScanner<TypeElement, Void>() { public TypeElement visitClass(ClassTree node, Void p) { try { return (TypeElement)controller.getTrees().getElement(getCurrentPath()); } catch (NullPointerException e) { Exceptions.printStackTrace(e); return null; } } }; return scanner.scan(controller.getCompilationUnit(), null); } }
parentToCopy = newParentCopy; Object v = super.scan(l, p); this.parentToCopy = saveParent; this.collectCommentsFromRemovedNodes = saveCollect;
classScanner.scan(u,null);
if (endPos < 0) return false; Boolean ret = tokens.offset() <= endPos ? super.scan(tree, p) : null; return ret != null ? ret : true;