6884227: Clarify ordering requirements of javax.lang.model.TypeElement.getEnclosedElements
authordarcy
Mon, 21 Sep 2009 21:08:11 -0700
changeset 3897 fe8cc7e3a505
parent 3896 dee59ffb538d
child 3898 6a163854aee4
child 3994 7df1ecd5eadb
6884227: Clarify ordering requirements of javax.lang.model.TypeElement.getEnclosedElements Reviewed-by: ahe
langtools/src/share/classes/javax/lang/model/element/TypeElement.java
--- a/langtools/src/share/classes/javax/lang/model/element/TypeElement.java	Fri Sep 18 08:48:50 2009 -0700
+++ b/langtools/src/share/classes/javax/lang/model/element/TypeElement.java	Mon Sep 21 21:08:11 2009 -0700
@@ -60,6 +60,22 @@
  * @since 1.6
  */
 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
+    /**
+     * {@inheritDoc}
+     *
+     * <p> Note that as a particular instance of the {@linkplain
+     * javax.lang.model.element general accuracy requirements} and the
+     * ordering behavior required of this interface, the list of
+     * enclosed elements will be returned in the natural order for the
+     * 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 synthesized
+     * elements, such as a default constructor, is not specified.)
+     *
+     * @return the enclosed elements in proper order, or an empty list if none
+     */
+    List<? extends Element> getEnclosedElements();
 
     /**
      * Returns the <i>nesting kind</i> of this type element.