8184683: Add @since and default methods of Compiler Tree API methods

Reviewed-by: darcy, jjg
This commit is contained in:
Kumar Srinivasan 2017-12-04 10:04:51 -08:00
parent f4db9575d1
commit 4fbcc568d3
2 changed files with 44 additions and 4 deletions

View File

@ -145,11 +145,19 @@ public interface DocTreeVisitor<R,P> {
/** /**
* Visits a HiddenTree node. * Visits a HiddenTree node.
*
* @implSpec Visits a {@code HiddenTree} node
* by calling {@code visitOther(node, p)}.
*
* @param node the node being visited * @param node the node being visited
* @param p a parameter value * @param p a parameter value
* @return a result 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. * Visits an IdentifierTree node.
@ -161,11 +169,19 @@ public interface DocTreeVisitor<R,P> {
/** /**
* Visits an IndexTree node. * Visits an IndexTree node.
*
* @implSpec Visits an {@code IndexTree} node
* by calling {@code visitOther(node, p)}.
*
* @param node the node being visited * @param node the node being visited
* @param p a parameter value * @param p a parameter value
* @return a result 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. * Visits an InheritDocTree node.
@ -201,11 +217,19 @@ public interface DocTreeVisitor<R,P> {
/** /**
* Visits a ProvidesTree node. * Visits a ProvidesTree node.
*
* @implSpec Visits a {@code ProvidesTree} node
* by calling {@code visitOther(node, p)}.
*
* @param node the node being visited * @param node the node being visited
* @param p a parameter value * @param p a parameter value
* @return a result 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. * Visits a ReferenceTree node.
@ -320,11 +344,19 @@ public interface DocTreeVisitor<R,P> {
/** /**
* Visits a UsesTree node. * Visits a UsesTree node.
*
* @implSpec Visits a {@code UsesTree} node
* by calling {@code visitOther(node, p)}.
*
* @param node the node being visited * @param node the node being visited
* @param p a parameter value * @param p a parameter value
* @return a result 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. * Visits a ValueTree node.

View File

@ -220,6 +220,8 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
* @param node {@inheritDoc} * @param node {@inheritDoc}
* @param p {@inheritDoc} * @param p {@inheritDoc}
* @return the result of {@code defaultAction} * @return the result of {@code defaultAction}
*
* @since 9
*/ */
@Override @Override
public R visitHidden(HiddenTree node, P p) { public R visitHidden(HiddenTree node, P p) {
@ -244,6 +246,8 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
* @param node {@inheritDoc} * @param node {@inheritDoc}
* @param p {@inheritDoc} * @param p {@inheritDoc}
* @return the result of {@code defaultAction} * @return the result of {@code defaultAction}
*
* @since 9
*/ */
@Override @Override
public R visitIndex(IndexTree node, P p) { public R visitIndex(IndexTree node, P p) {
@ -304,6 +308,8 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
* @param node {@inheritDoc} * @param node {@inheritDoc}
* @param p {@inheritDoc} * @param p {@inheritDoc}
* @return the result of {@code defaultAction} * @return the result of {@code defaultAction}
*
* @since 9
*/ */
@Override @Override
public R visitProvides(ProvidesTree node, P p) { public R visitProvides(ProvidesTree node, P p) {
@ -473,6 +479,8 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
* @param node {@inheritDoc} * @param node {@inheritDoc}
* @param p {@inheritDoc} * @param p {@inheritDoc}
* @return the result of {@code defaultAction} * @return the result of {@code defaultAction}
*
* @since 9
*/ */
@Override @Override
public R visitUses(UsesTree node, P p) { public R visitUses(UsesTree node, P p) {