langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java
changeset 24069 dfb8f11542fc
parent 17578 46ac954e4a84
child 24604 7f68545b5128
equal deleted inserted replaced
24068:d8a1180faaa9 24069:dfb8f11542fc
    25 
    25 
    26 package com.sun.tools.javadoc;
    26 package com.sun.tools.javadoc;
    27 
    27 
    28 import javax.tools.JavaFileObject;
    28 import javax.tools.JavaFileObject;
    29 
    29 
       
    30 import com.sun.source.util.TreePath;
    30 import com.sun.tools.javac.code.Kinds;
    31 import com.sun.tools.javac.code.Kinds;
    31 import com.sun.tools.javac.code.Symbol.*;
    32 import com.sun.tools.javac.code.Symbol.*;
    32 import com.sun.tools.javac.comp.Enter;
    33 import com.sun.tools.javac.comp.Enter;
    33 import com.sun.tools.javac.tree.JCTree.*;
    34 import com.sun.tools.javac.tree.JCTree.*;
    34 import com.sun.tools.javac.util.Context;
    35 import com.sun.tools.javac.util.Context;
    82 
    83 
    83     @Override
    84     @Override
    84     public void visitTopLevel(JCCompilationUnit tree) {
    85     public void visitTopLevel(JCCompilationUnit tree) {
    85         super.visitTopLevel(tree);
    86         super.visitTopLevel(tree);
    86         if (tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) {
    87         if (tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) {
    87             docenv.makePackageDoc(tree.packge, docenv.getTreePath(tree));
    88             JCPackageDecl pd = tree.getPackage();
       
    89             TreePath tp = pd == null ? docenv.getTreePath(tree) : docenv.getTreePath(tree, pd);
       
    90             docenv.makePackageDoc(tree.packge, tp);
    88         }
    91         }
    89     }
    92     }
    90 
    93 
    91     @Override
    94     @Override
    92     public void visitClassDef(JCClassDecl tree) {
    95     public void visitClassDef(JCClassDecl tree) {