Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8250660: Clarify that WildcardType and AnnotatedWildcardType bounds m…
…ethods return one

Reviewed-by: mchung, dholmes
  • Loading branch information
jddarcy committed Aug 6, 2020
1 parent 087dd7d commit 8c4b228755fe5d71587d9d35edf803ba89543247
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
@@ -40,6 +40,10 @@ public interface AnnotatedWildcardType extends AnnotatedType {
* If no lower bound is explicitly declared, the lower bound is the
* type of null. In this case, a zero length array is returned.
*
* @apiNote While to date a wildcard may have at most one lower
* bound, callers of this method should be written to accommodate
* multiple bounds.
*
* @return the potentially annotated lower bounds of this wildcard type or
* an empty array if no lower bound is explicitly declared.
* @see WildcardType#getLowerBounds()
@@ -51,6 +55,10 @@ public interface AnnotatedWildcardType extends AnnotatedType {
* If no upper bound is explicitly declared, the upper bound is
* unannotated {@code Object}
*
* @apiNote While to date a wildcard may have at most one upper
* bound, callers of this method should be written to accommodate
* multiple bounds.
*
* @return the potentially annotated upper bounds of this wildcard type
* @see WildcardType#getUpperBounds()
*/
@@ -46,6 +46,10 @@ public interface WildcardType extends Type {
* <li>Otherwise, B is resolved.
* </ul>
*
* @apiNote While to date a wildcard may have at most one upper
* bound, callers of this method should be written to accommodate
* multiple bounds.
*
* @return an array of Types representing the upper bound(s) of this
* type variable
* @throws TypeNotPresentException if any of the
@@ -70,6 +74,10 @@ public interface WildcardType extends Type {
* <li>Otherwise, B is resolved.
* </ul>
*
* @apiNote While to date a wildcard may have at most one lower
* bound, callers of this method should be written to accommodate
* multiple bounds.
*
* @return an array of Types representing the lower bound(s) of this
* type variable
* @throws TypeNotPresentException if any of the
@@ -79,6 +87,4 @@ public interface WildcardType extends Type {
* for any reason
*/
Type[] getLowerBounds();
// one or many? Up to language spec; currently only one, but this API
// allows for generalization.
}

0 comments on commit 8c4b228

Please sign in to comment.