326 |
326 |
327 static abstract class DeclScanner extends TreePathScanner<Void, Void> { |
327 static abstract class DeclScanner extends TreePathScanner<Void, Void> { |
328 abstract void visitDecl(Tree tree, Name name); |
328 abstract void visitDecl(Tree tree, Name name); |
329 |
329 |
330 @Override |
330 @Override |
|
331 public Void visitCompilationUnit(CompilationUnitTree tree, Void ignore) { |
|
332 if (tree.getPackageName() != null) { |
|
333 visitDecl(tree, null); |
|
334 } |
|
335 return super.visitCompilationUnit(tree, ignore); |
|
336 } |
|
337 |
|
338 @Override |
331 public Void visitClass(ClassTree tree, Void ignore) { |
339 public Void visitClass(ClassTree tree, Void ignore) { |
332 visitDecl(tree, tree.getSimpleName()); |
340 visitDecl(tree, tree.getSimpleName()); |
333 return super.visitClass(tree, ignore); |
341 return super.visitClass(tree, ignore); |
334 } |
342 } |
335 |
343 |