--- old/src/share/classes/javax/lang/model/element/Element.java 2012-01-18 16:39:29.000000000 -0800 +++ new/src/share/classes/javax/lang/model/element/Element.java 2012-01-18 16:39:29.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,14 +214,13 @@ * Returns the elements that are, loosely speaking, directly * enclosed by this element. * - * A class or interface is considered to enclose the fields, - * methods, constructors, and member types that it directly - * declares. This includes any (implicit) default constructor and - * the implicit {@code values} and {@code valueOf} methods of an - * enum type. - * - * A package encloses the top-level classes and interfaces within - * it, but is not considered to enclose subpackages. + * A {@linkplain TypeElement#getEnclosedElements class or + * interface} is considered to enclose the fields, methods, + * constructors, and member types that it directly declares. + * + * A {@linkplain PackageElement#getEnclosedElements package} + * encloses the top-level classes and interfaces within it, but is + * not considered to enclose subpackages. * * Other kinds of elements are not currently considered to enclose * any elements; however, that may change as this API or the @@ -231,6 +230,8 @@ * methods in {@link ElementFilter}. * * @return the enclosed elements, or an empty list if none + * @see PackageElement#getEnclosedElements + * @see TypeElement#getEnclosedElements * @see Elements#getAllMembers * @jls 8.8.9 Default Constructor * @jls 8.9 Enums --- old/src/share/classes/javax/lang/model/element/PackageElement.java 2012-01-18 16:39:29.000000000 -0800 +++ new/src/share/classes/javax/lang/model/element/PackageElement.java 2012-01-18 16:39:29.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package javax.lang.model.element; +import java.util.List; + /** * Represents a package program element. Provides access to information * about the package and its members. @@ -49,7 +51,7 @@ /** * Returns the simple name of this package. For an unnamed - * package, an empty name is returned + * package, an empty name is returned. * * @return the simple name of this package or an empty name if * this is an unnamed package @@ -58,6 +60,18 @@ Name getSimpleName(); /** + * Returns the {@linkplain NestingKind#TOP_LEVEL top-level} + * classes and interfaces within this package. Note that + * subpackages are not considered to be enclosed by a + * package. + * + * @return the top-level classes and interfaces within this + * package + */ + @Override + List getEnclosedElements(); + + /** * Returns {@code true} is this is an unnamed package and {@code * false} otherwise. * --- old/src/share/classes/javax/lang/model/element/TypeElement.java 2012-01-18 16:39:30.000000000 -0800 +++ new/src/share/classes/javax/lang/model/element/TypeElement.java 2012-01-18 16:39:30.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,12 @@ */ public interface TypeElement extends Element, Parameterizable, QualifiedNameable { /** - * {@inheritDoc} + * 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. * *

Note that as a particular instance of the {@linkplain * javax.lang.model.element general accuracy requirements} and the @@ -75,6 +80,7 @@ * * @return the enclosed elements in proper order, or an empty list if none */ + @Override List getEnclosedElements(); /**