--- old/src/java.compiler/share/classes/javax/lang/model/element/AnnotationValueVisitor.java 2020-03-13 20:20:59.462000000 -0700 +++ new/src/java.compiler/share/classes/javax/lang/model/element/AnnotationValueVisitor.java 2020-03-13 20:20:58.878000000 -0700 @@ -48,33 +48,34 @@ * is {@code null}; see documentation of the implementing class for * details. * - *

WARNING: It is possible that methods will be added to - * this interface to accommodate new, currently unknown, language + * @apiNote + * WARNING: It is possible that methods will be added + * to this interface to accommodate new, currently unknown, language * structures added to future versions of the Java™ programming - * language. Therefore, visitor classes directly implementing this - * interface may be source incompatible with future versions of the - * platform. To avoid this source incompatibility, visitor - * implementations are encouraged to instead extend the appropriate - * abstract visitor class that implements this interface. However, an - * API should generally use this visitor interface as the type for - * parameters, return type, etc. rather than one of the abstract - * classes. + * language. * - *

Note that methods to accommodate new language constructs could - * be added in a source compatible way if they were added as - * default methods. However, default methods are only - * available on Java SE 8 and higher releases and the {@code - * javax.lang.model.*} packages bundled in Java SE 8 were required to - * also be runnable on Java SE 7. Therefore, default methods - * were not used when extending {@code javax.lang.model.*} - * to cover Java SE 8 language features. However, default methods - * are used in subsequent revisions of the {@code javax.lang.model.*} - * packages that are only required to run on Java SE 8 and higher - * platform versions. + * Such additions have already occurred in another visitor interface in + * this package to support language features added after this API was + * introduced. * - * @apiNote + * Visitor classes directly implementing this interface may be source + * incompatible with future versions of the platform. To avoid this + * source incompatibility, visitor implementations are encouraged to + * instead extend the appropriate abstract visitor class that + * implements this interface. However, an API should generally use + * this visitor interface as the type for parameters, return type, + * etc. rather than one of the abstract classes. + * + *

Methods to accommodate new language constructs are expected to + * be added as default methods to provide strong source compatibility, + * as done for {@link ElementVisitor#visitModule visitModule} in + * {@code ElementVisitor}. The implementations of the default methods + * in this interface will in turn call {@link visitUnknown + * visitUnknown}, behavior that will be overridden in concrete + * visitors supporting the source version with the new language + * construct. * - * There are several families of classes implementing this visitor + *

There are several families of classes implementing this visitor * interface in the {@linkplain javax.lang.model.util util * package}. The families follow a naming pattern along the lines of * {@code FooVisitor}N where N indicates the