< prev index next >

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

Print this page

        

*** 915,925 **** * the entity (class, interface, primitive type or void) represented by * this {@code Class}. * * <p>If the superclass is a parameterized type, the {@code Type} * object returned must accurately reflect the actual type ! * parameters used in the source code. The parameterized type * representing the superclass is created if it had not been * created before. See the declaration of {@link * java.lang.reflect.ParameterizedType ParameterizedType} for the * semantics of the creation process for parameterized types. If * this {@code Class} represents either the {@code Object} --- 915,925 ---- * the entity (class, interface, primitive type or void) represented by * this {@code Class}. * * <p>If the superclass is a parameterized type, the {@code Type} * object returned must accurately reflect the actual type ! * arguments used in the source code. The parameterized type * representing the superclass is created if it had not been * created before. See the declaration of {@link * java.lang.reflect.ParameterizedType ParameterizedType} for the * semantics of the creation process for parameterized types. If * this {@code Class} represents either the {@code Object}
*** 1095,1105 **** * directly implemented by the class or interface represented by * this object. * * <p>If a superinterface is a parameterized type, the * {@code Type} object returned for it must accurately reflect ! * the actual type parameters used in the source code. The * parameterized type representing each superinterface is created * if it had not been created before. See the declaration of * {@link java.lang.reflect.ParameterizedType ParameterizedType} * for the semantics of the creation process for parameterized * types. --- 1095,1105 ---- * directly implemented by the class or interface represented by * this object. * * <p>If a superinterface is a parameterized type, the * {@code Type} object returned for it must accurately reflect ! * the actual type arguments used in the source code. The * parameterized type representing each superinterface is created * if it had not been created before. See the declaration of * {@link java.lang.reflect.ParameterizedType ParameterizedType} * for the semantics of the creation process for parameterized * types.
*** 3638,3650 **** --- 3638,3653 ---- else throw new ClassCastException(this.toString()); } /** + * {@inheritDoc} + * <p>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);
*** 3659,3668 **** --- 3662,3673 ---- public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { return GenericDeclaration.super.isAnnotationPresent(annotationClass); } /** + * {@inheritDoc} + * <p>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) {
*** 3673,3689 **** --- 3678,3699 ---- this, annotationClass); } /** + * {@inheritDoc} + * <p>Any annotations returned by this method are declaration annotations. * @since 1.5 */ + @Override public Annotation[] getAnnotations() { return AnnotationParser.toArray(annotationData().annotations); } /** + * {@inheritDoc} + * <p>Any annotation returned by this method is a declaration annotation. * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @Override @SuppressWarnings("unchecked")
*** 3692,3701 **** --- 3702,3713 ---- return (A) annotationData().declaredAnnotations.get(annotationClass); } /** + * {@inheritDoc} + * <p>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) {
*** 3704,3715 **** --- 3716,3730 ---- return AnnotationSupport.getDirectlyAndIndirectlyPresent(annotationData().declaredAnnotations, annotationClass); } /** + * {@inheritDoc} + * <p>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 >