< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java

Print this page

        

@@ -3030,15 +3030,15 @@
      * @param e an Element
      * @return TreePath
      */
     public TreePath getTreePath(Element e) {
         DocCommentDuo duo = dcTreeCache.get(e);
-        if (duo != null && duo.treePath != null) {
+        if (isValidDuo(duo) && duo.treePath != null) {
             return duo.treePath;
         }
         duo = configuration.cmtUtils.getSyntheticCommentDuo(e);
-        if (duo != null && duo.treePath != null) {
+        if (isValidDuo(duo) && duo.treePath != null) {
             return duo.treePath;
         }
         Map<Element, TreePath> elementToTreePath = configuration.workArounds.getElementToTreePath();
         TreePath path = elementToTreePath.get(e);
         if (path != null || elementToTreePath.containsKey(e)) {

@@ -3060,24 +3060,24 @@
         DocCommentDuo duo = null;
 
         ElementKind kind = element.getKind();
         if (kind == ElementKind.PACKAGE || kind == ElementKind.OTHER) {
             duo = dcTreeCache.get(element); // local cache
-            if (duo == null && kind == ElementKind.PACKAGE) {
+            if (!isValidDuo(duo) && kind == ElementKind.PACKAGE) {
                 // package-info.java
                 duo = getDocCommentTuple(element);
             }
-            if (duo == null) {
+            if (!isValidDuo(duo)) {
                 // package.html or overview.html
                 duo = configuration.cmtUtils.getHtmlCommentDuo(element); // html source
             }
         } else {
             duo = configuration.cmtUtils.getSyntheticCommentDuo(element);
-            if (duo == null) {
+            if (!isValidDuo(duo)) {
                 duo = dcTreeCache.get(element); // local cache
             }
-            if (duo == null) {
+            if (!isValidDuo(duo)) {
                 duo = getDocCommentTuple(element); // get the real mccoy
             }
         }
 
         DocCommentTree docCommentTree = isValidDuo(duo) ? duo.dcTree : null;
< prev index next >