mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8225540: In core reflection note whether returned annotations are declaration or type annotations
Reviewed-by: alanb, prappo
This commit is contained in:
parent
b7d5172b89
commit
455d2e7cea
13 changed files with 209 additions and 24 deletions
|
@ -434,9 +434,14 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>Note that any annotation returned by this method is a
|
||||
* declaration annotation.
|
||||
*
|
||||
* @throws NullPointerException {@inheritDoc}
|
||||
* @since 1.5
|
||||
*/
|
||||
@Override
|
||||
public <A extends Annotation> A getAnnotation(Class<A> annotationClass) {
|
||||
return getPackageInfo().getAnnotation(annotationClass);
|
||||
}
|
||||
|
@ -452,6 +457,10 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>Note that any annotations returned by this method are
|
||||
* declaration annotations.
|
||||
*
|
||||
* @throws NullPointerException {@inheritDoc}
|
||||
* @since 1.8
|
||||
*/
|
||||
|
@ -461,13 +470,21 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>Note that any annotations returned by this method are
|
||||
* declaration annotations.
|
||||
* @since 1.5
|
||||
*/
|
||||
@Override
|
||||
public Annotation[] getAnnotations() {
|
||||
return getPackageInfo().getAnnotations();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>Note that any annotation returned by this method is a
|
||||
* declaration annotation.
|
||||
*
|
||||
* @throws NullPointerException {@inheritDoc}
|
||||
* @since 1.8
|
||||
*/
|
||||
|
@ -486,8 +503,12 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>Note that any annotations returned by this method are
|
||||
* declaration annotations.
|
||||
* @since 1.5
|
||||
*/
|
||||
@Override
|
||||
public Annotation[] getDeclaredAnnotations() {
|
||||
return getPackageInfo().getDeclaredAnnotations();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue