langtools/src/share/classes/com/sun/tools/doclint/Checker.java
changeset 24069 dfb8f11542fc
parent 22153 f9f06fcca59d
--- a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java	Tue Apr 22 19:52:15 2014 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java	Tue Apr 22 17:07:54 2014 -0400
@@ -75,6 +75,7 @@
 import com.sun.source.doctree.UnknownInlineTagTree;
 import com.sun.source.doctree.ValueTree;
 import com.sun.source.doctree.VersionTree;
+import com.sun.source.tree.Tree;
 import com.sun.source.util.DocTreePath;
 import com.sun.source.util.DocTreePathScanner;
 import com.sun.source.util.TreePath;
@@ -145,8 +146,8 @@
 
         boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
 
-        if (p.getLeaf() == p.getCompilationUnit()) {
-            // If p points to a compilation unit, the implied declaration is the
+        if (p.getLeaf().getKind() == Tree.Kind.PACKAGE) {
+            // If p points to a package, the implied declaration is the
             // package declaration (if any) for the compilation unit.
             // Handle this case specially, because doc comments are only
             // expected in package-info files.