changeset 48266:532cdc178e42

8184683: Add @since and default methods of Compiler Tree API methods Reviewed-by: darcy, jjg
author ksrini
date Mon, 04 Dec 2017 10:04:51 -0800
parents 6ee80cd217e0
children 665769d3cee4
files src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
diffstat 2 files changed, 44 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java	Mon Dec 04 11:50:04 2017 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java	Mon Dec 04 10:04:51 2017 -0800
@@ -145,11 +145,19 @@
 
     /**
      * Visits a HiddenTree node.
+     *
+     * @implSpec Visits a {@code HiddenTree} node
+     * by calling {@code visitOther(node, p)}.
+     *
      * @param node the node being visited
      * @param p a parameter value
      * @return a result value
+     *
+     * @since 9
      */
-    R visitHidden(HiddenTree node, P p);
+    default R visitHidden(HiddenTree node, P p)  {
+        return visitOther(node, p);
+    }
 
     /**
      * Visits an IdentifierTree node.
@@ -161,11 +169,19 @@
 
     /**
      * Visits an IndexTree node.
+     *
+     * @implSpec Visits an {@code IndexTree} node
+     * by calling {@code visitOther(node, p)}.
+     *
      * @param node the node being visited
      * @param p a parameter value
      * @return a result value
+     *
+     * @since 9
      */
-    R visitIndex(IndexTree node, P p);
+    default R visitIndex(IndexTree node, P p) {
+        return visitOther(node, p);
+    }
 
     /**
      * Visits an InheritDocTree node.
@@ -201,11 +217,19 @@
 
     /**
      * Visits a ProvidesTree node.
+     *
+     * @implSpec Visits a {@code ProvidesTree} node
+     * by calling {@code visitOther(node, p)}.
+     *
      * @param node the node being visited
      * @param p a parameter value
      * @return a result value
+     *
+     * @since 9
      */
-    R visitProvides(ProvidesTree node, P p);
+    default R visitProvides(ProvidesTree node, P p) {
+        return visitOther(node, p);
+    }
 
     /**
      * Visits a ReferenceTree node.
@@ -320,11 +344,19 @@
 
     /**
      * Visits a UsesTree node.
+     *
+     * @implSpec Visits a {@code UsesTree} node
+     * by calling {@code visitOther(node, p)}.
+     *
      * @param node the node being visited
      * @param p a parameter value
      * @return a result value
+     *
+     * @since 9
      */
-    R visitUses(UsesTree node, P p);
+    default R visitUses(UsesTree node, P p) {
+        return visitOther(node, p);
+    }
 
     /**
      * Visits a ValueTree node.
--- a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java	Mon Dec 04 11:50:04 2017 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java	Mon Dec 04 10:04:51 2017 -0800
@@ -220,6 +220,8 @@
      * @param node {@inheritDoc}
      * @param p {@inheritDoc}
      * @return the result of {@code defaultAction}
+     *
+     * @since 9
      */
     @Override
     public R visitHidden(HiddenTree node, P p) {
@@ -244,6 +246,8 @@
      * @param node {@inheritDoc}
      * @param p {@inheritDoc}
      * @return  the result of {@code defaultAction}
+     *
+     * @since 9
      */
     @Override
     public R visitIndex(IndexTree node, P p) {
@@ -304,6 +308,8 @@
      * @param node {@inheritDoc}
      * @param p {@inheritDoc}
      * @return  the result of {@code defaultAction}
+     *
+     * @since 9
      */
     @Override
     public R visitProvides(ProvidesTree node, P p) {
@@ -473,6 +479,8 @@
      * @param node {@inheritDoc}
      * @param p {@inheritDoc}
      * @return  the result of {@code defaultAction}
+     *
+     * @since 9
      */
     @Override
     public R visitUses(UsesTree node, P p) {