< prev index next >
src/java.base/share/classes/java/lang/reflect/Field.java
Print this page
*** 241,253 ****
/**
* Returns a {@code Type} object that represents the declared type for
* the field represented by this {@code Field} object.
*
! * <p>If the {@code Type} is a parameterized type, the
! * {@code Type} object returned must accurately reflect the
! * actual type parameters used in the source code.
*
* <p>If the type of the underlying field is a type variable or a
* parameterized type, it is created. Otherwise, it is resolved.
*
* @return a {@code Type} object that represents the declared type for
--- 241,253 ----
/**
* Returns a {@code Type} object that represents the declared type for
* the field represented by this {@code Field} object.
*
! * <p>If the declared type of the field is a parameterized type,
! * the {@code Type} object returned must accurately reflect the
! * type arguments used in the source code.
*
* <p>If the type of the underlying field is a type variable or a
* parameterized type, it is created. Otherwise, it is resolved.
*
* @return a {@code Type} object that represents the declared type for
*** 1132,1144 ****
--- 1132,1146 ----
Field getRoot() {
return root;
}
/**
+ * {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
+ @Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
Objects.requireNonNull(annotationClass);
return annotationClass.cast(declaredAnnotations().get(annotationClass));
}
*** 1155,1164 ****
--- 1157,1167 ----
}
/**
* {@inheritDoc}
*/
+ @Override
public Annotation[] getDeclaredAnnotations() {
return AnnotationParser.toArray(declaredAnnotations());
}
private transient volatile Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
< prev index next >