8173944: Reference Origin.MANDATED in getEnclosedElements specs
Reviewed-by: jlahoda
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/Element.java Mon Feb 06 12:35:13 2017 -0800
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/Element.java Mon Feb 06 16:32:37 2017 -0800
@@ -176,6 +176,9 @@
* A {@linkplain ModuleElement#getEnclosedElements module}
* encloses packages within it.
*
+ * Enclosed elements may include implicitly declared {@linkplain
+ * Elements.Origin#MANDATED mandated} elements.
+ *
* Other kinds of elements are not currently considered to enclose
* any elements; however, that may change as this API or the
* programming language evolves.
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java Mon Feb 06 12:35:13 2017 -0800
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java Mon Feb 06 16:32:37 2017 -0800
@@ -63,9 +63,10 @@
* Returns the fields, methods, constructors, and member types
* that are directly declared in this class or interface.
*
- * This includes any (implicit) default constructor and
- * the implicit {@code values} and {@code valueOf} methods of an
- * enum type.
+ * This includes any {@linkplain Elements.Origin#MANDATED
+ * mandated} elements such as the (implicit) default constructor
+ * and the implicit {@code values} and {@code valueOf} methods of
+ * an enum type.
*
* @apiNote As a particular instance of the {@linkplain
* javax.lang.model.element general accuracy requirements} and the
@@ -74,10 +75,13 @@
* originating source of information about the type. For example,
* if the information about the type is originating from a source
* file, the elements will be returned in source code order.
- * (However, in that case the the ordering of {@linkplain Elements.Origin#MANDATED mandated}
- * elements, such as a default constructor, is not specified.)
+ * (However, in that case the the ordering of elements, such as a
+ * default constructor, is not specified.)
*
* @return the enclosed elements in proper order, or an empty list if none
+ *
+ * @jls 8.8.9 Default Constructor
+ * @jls 8.9.3 Enum Members
*/
@Override
List<? extends Element> getEnclosedElements();
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/Elements.java Mon Feb 06 12:35:13 2017 -0800
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/Elements.java Mon Feb 06 16:32:37 2017 -0800
@@ -282,6 +282,7 @@
* multiple annotations of a repeatable annotation type.
*
* @jls 8.8.9 Default Constructor
+ * @jls 8.9.3 Enum Members
* @jls 9.6.3 Repeatable Annotation Types
* @jls 9.7.5 Multiple Annotations of the Same Type
*/