--- a/jdk/src/share/classes/java/lang/reflect/Constructor.java Thu Oct 24 13:06:05 2013 -0400
+++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java Thu Oct 24 19:04:27 2013 +0200
@@ -28,6 +28,8 @@
import sun.reflect.CallerSensitive;
import sun.reflect.ConstructorAccessor;
import sun.reflect.Reflection;
+import sun.reflect.annotation.TypeAnnotation;
+import sun.reflect.annotation.TypeAnnotationParser;
import sun.reflect.generics.repository.ConstructorRepository;
import sun.reflect.generics.factory.CoreReflectionFactory;
import sun.reflect.generics.factory.GenericsFactory;
@@ -534,4 +536,22 @@
public AnnotatedType getAnnotatedReturnType() {
return getAnnotatedReturnType0(getDeclaringClass());
}
+
+ /**
+ * {@inheritDoc}
+ * @since 1.8
+ */
+ @Override
+ public AnnotatedType getAnnotatedReceiverType() {
+ if (getDeclaringClass().getEnclosingClass() == null)
+ return super.getAnnotatedReceiverType();
+
+ return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
+ sun.misc.SharedSecrets.getJavaLangAccess().
+ getConstantPool(getDeclaringClass()),
+ this,
+ getDeclaringClass(),
+ getDeclaringClass().getEnclosingClass(),
+ TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
+ }
}