8225540: In core reflection note whether returned annotations are declaration or type annotations

Reviewed-by: alanb, prappo
This commit is contained in:
Joe Darcy 2020-04-09 14:16:17 -07:00
parent b7d5172b89
commit 455d2e7cea
13 changed files with 209 additions and 24 deletions

View file

@ -1381,6 +1381,9 @@ public final class Module implements AnnotatedElement {
/**
* {@inheritDoc}
* This method returns {@code null} when invoked on an unnamed module.
*
* <p> Note that any annotation returned by this method is a
* declaration annotation.
*/
@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
@ -1390,6 +1393,9 @@ public final class Module implements AnnotatedElement {
/**
* {@inheritDoc}
* This method returns an empty array when invoked on an unnamed module.
*
* <p> Note that any annotations returned by this method are
* declaration annotations.
*/
@Override
public Annotation[] getAnnotations() {
@ -1399,6 +1405,9 @@ public final class Module implements AnnotatedElement {
/**
* {@inheritDoc}
* This method returns an empty array when invoked on an unnamed module.
*
* <p> Note that any annotations returned by this method are
* declaration annotations.
*/
@Override
public Annotation[] getDeclaredAnnotations() {