# HG changeset patch # User darcy # Date 1516240417 28800 # Node ID b6bb930cd488a986befea61c0a7dfb01a637e5d4 # Parent 860326263d1f6a83996d7da0f4c66806ae4aa1eb 8191839: ModuleElement.DirectiveVisitor :: visit​() method behavior is deviating from the spec Reviewed-by: jjg diff -r 860326263d1f -r b6bb930cd488 src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java --- a/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java Thu Jan 18 02:25:18 2018 +0300 +++ b/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java Wed Jan 17 17:53:37 2018 -0800 @@ -152,8 +152,8 @@ /** * Visits a module element. * - * @implSpec Visits a {@code ModuleElement} by calling {@code - * visitUnknown(e, p)}. + * @implSpec The default implementation visits a {@code + * ModuleElement} by calling {@code visitUnknown(e, p)}. * * @param e the element to visit * @param p a visitor-specified parameter diff -r 860326263d1f -r b6bb930cd488 src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java --- a/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java Thu Jan 18 02:25:18 2018 +0300 +++ b/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java Wed Jan 17 17:53:37 2018 -0800 @@ -201,11 +201,10 @@ * Visits any directive as if by passing itself to that * directive's {@link Directive#accept accept} method and passing * {@code null} for the additional parameter. - * The invocation {@code v.visit(d)} is equivalent to - * {@code d.accept(v, null)}. + * * @param d the directive to visit * @return a visitor-specified result - * @implSpec This implementation is {@code visit(d, null)} + * @implSpec The default implementation is {@code d.accept(v, null)}. */ default R visit(Directive d) { return d.accept(this, null); @@ -214,11 +213,11 @@ /** * Visits any directive as if by passing itself to that * directive's {@link Directive#accept accept} method. - * The invocation {@code v.visit(d, p)} is equivalent to - * {@code d.accept(v, p)}. + * * @param d the directive to visit * @param p a visitor-specified parameter * @return a visitor-specified result + * @implSpec The default implementation is {@code d.accept(v, p)}. */ default R visit(Directive d, P p) { return d.accept(this, p); @@ -271,7 +270,7 @@ * @param p a visitor-specified parameter * @return a visitor-specified result * @throws UnknownDirectiveException a visitor implementation may optionally throw this exception - * @implSpec This implementation throws {@code new UnknownDirectiveException(d, p)}. + * @implSpec The default implementation throws {@code new UnknownDirectiveException(d, p)}. */ default R visitUnknown(Directive d, P p) { throw new UnknownDirectiveException(d, p);