< prev index next >
src/java.base/share/classes/java/lang/reflect/AccessibleObject.java
Print this page
*** 507,519 ****
--- 507,524 ----
static final ReflectionFactory reflectionFactory =
AccessController.doPrivileged(
new ReflectionFactory.GetReflectionFactoryAction());
/**
+ * {@inheritDoc}
+ * <p>Note that any annotation returned by this method is a
+ * declaration annotation.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
+ @Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
throw new AssertionError("All subclasses should override this method");
}
/**
*** 525,550 ****
--- 530,568 ----
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
return AnnotatedElement.super.isAnnotationPresent(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@Override
public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
throw new AssertionError("All subclasses should override this method");
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @since 1.5
*/
+ @Override
public Annotation[] getAnnotations() {
return getDeclaredAnnotations();
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotation returned by this method is a
+ * declaration annotation.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@Override
public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
*** 553,562 ****
--- 571,584 ----
// getAnnotation.
return getAnnotation(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@Override
public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) {
*** 565,576 ****
--- 587,603 ----
// getAnnotationsByType.
return getAnnotationsByType(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @since 1.5
*/
+ @Override
public Annotation[] getDeclaredAnnotations() {
throw new AssertionError("All subclasses should override this method");
}
// Shared access checking logic.
< prev index next >