< prev index next >
src/java.base/share/classes/java/lang/reflect/Method.java
Print this page
*** 28,37 ****
--- 28,39 ----
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.SharedSecrets;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.MethodAccessor;
import jdk.internal.reflect.Reflection;
+ import sun.reflect.annotation.ExceptionProxy;
+ import sun.reflect.annotation.TypeNotPresentExceptionProxy;
import sun.reflect.generics.repository.MethodRepository;
import sun.reflect.generics.factory.CoreReflectionFactory;
import sun.reflect.generics.factory.GenericsFactory;
import sun.reflect.generics.scope.MethodScope;
import sun.reflect.annotation.AnnotationType;
*** 639,650 ****
Object result = AnnotationParser.parseMemberValue(
memberType, ByteBuffer.wrap(annotationDefault),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
getDeclaringClass());
! if (result instanceof sun.reflect.annotation.ExceptionProxy)
throw new AnnotationFormatError("Invalid default: " + this);
return result;
}
/**
* {@inheritDoc}
--- 641,657 ----
Object result = AnnotationParser.parseMemberValue(
memberType, ByteBuffer.wrap(annotationDefault),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
getDeclaringClass());
! if (result instanceof ExceptionProxy) {
! if (result instanceof TypeNotPresentExceptionProxy) {
! TypeNotPresentExceptionProxy proxy = (TypeNotPresentExceptionProxy)result;
! throw new TypeNotPresentException(proxy.typeName(), proxy.getCause());
! }
throw new AnnotationFormatError("Invalid default: " + this);
+ }
return result;
}
/**
* {@inheritDoc}
< prev index next >