8004832: Add new doclint package

Reviewed-by: mcimadamore
This commit is contained in:
Jonathan Gibbons 2012-12-17 07:47:05 -08:00
parent c5acce4569
commit 4a3e904c6e
100 changed files with 4459 additions and 28 deletions

View file

@ -60,14 +60,20 @@ public class TreePath implements Iterable<Tree> {
this.path = path;
}
}
class PathFinder extends TreePathScanner<TreePath,Tree> {
public TreePath scan(Tree tree, Tree target) {
if (tree == target)
if (tree == target) {
throw new Result(new TreePath(getCurrentPath(), target));
}
return super.scan(tree, target);
}
}
if (path.getLeaf() == target) {
return path;
}
try {
new PathFinder().scan(path, target);
} catch (Result result) {