8020278: NPE in javadoc

Reviewed-by: mcimadamore, vromero
This commit is contained in:
Jonathan Gibbons 2013-07-12 13:11:12 -07:00
parent 617386d568
commit 9dd2fe90d4
4 changed files with 32 additions and 1 deletions

View file

@ -327,6 +327,14 @@ public class DocLint implements Plugin {
static abstract class DeclScanner extends TreePathScanner<Void, Void> {
abstract void visitDecl(Tree tree, Name name);
@Override
public Void visitCompilationUnit(CompilationUnitTree tree, Void ignore) {
if (tree.getPackageName() != null) {
visitDecl(tree, null);
}
return super.visitCompilationUnit(tree, ignore);
}
@Override
public Void visitClass(ClassTree tree, Void ignore) {
visitDecl(tree, tree.getSimpleName());