< prev index next >

src/java.base/share/classes/java/lang/Class.java

Print this page

        

*** 3777,3789 **** --- 3777,3794 ---- else throw new ClassCastException(this.toString()); } /** + * {@inheritDoc} + * <p>Note that any annotation returned by this method is a + * declaration annotation. + * * @throws NullPointerException {@inheritDoc} * @since 1.5 */ + @Override @SuppressWarnings("unchecked") public <A extends Annotation> A getAnnotation(Class<A> annotationClass) { Objects.requireNonNull(annotationClass); return (A) annotationData().annotations.get(annotationClass);
*** 3798,3807 **** --- 3803,3816 ---- public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { return GenericDeclaration.super.isAnnotationPresent(annotationClass); } /** + * {@inheritDoc} + * <p>Note that any annotations returned by this method are + * declaration annotations. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @Override public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationClass) {
*** 3812,3828 **** --- 3821,3846 ---- this, annotationClass); } /** + * {@inheritDoc} + * <p>Note that any annotations returned by this method are + * declaration annotations. + * * @since 1.5 */ + @Override public Annotation[] getAnnotations() { return AnnotationParser.toArray(annotationData().annotations); } /** + * {@inheritDoc} + * <p>Note that any annotation returned by this method is a + * declaration annotation. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @Override @SuppressWarnings("unchecked")
*** 3831,3840 **** --- 3849,3862 ---- return (A) annotationData().declaredAnnotations.get(annotationClass); } /** + * {@inheritDoc} + * <p>Note that any annotations returned by this method are + * declaration annotations. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @Override public <A extends Annotation> A[] getDeclaredAnnotationsByType(Class<A> annotationClass) {
*** 3843,3854 **** --- 3865,3881 ---- return AnnotationSupport.getDirectlyAndIndirectlyPresent(annotationData().declaredAnnotations, annotationClass); } /** + * {@inheritDoc} + * <p>Note that any annotations returned by this method are + * declaration annotations. + * * @since 1.5 */ + @Override public Annotation[] getDeclaredAnnotations() { return AnnotationParser.toArray(annotationData().declaredAnnotations); } // annotation data that might get invalidated when JVM TI RedefineClasses() is called
< prev index next >