changeset 7944:38e1821c4472

8007808: Missing method: Executable.getAnnotatedReturnType() Reviewed-by: darcy, forax
author jfranck
date Wed, 06 Mar 2013 18:35:51 +0100
parents 34372bb9115d
children 14e49a70729a
files src/share/classes/java/lang/reflect/Constructor.java src/share/classes/java/lang/reflect/Executable.java src/share/classes/java/lang/reflect/Method.java
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/reflect/Constructor.java	Tue Mar 05 19:25:35 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Constructor.java	Wed Mar 06 18:35:51 2013 +0100
@@ -532,6 +532,7 @@
      * {@inheritDoc}
      * @since 1.8
      */
+    @Override
     public AnnotatedType getAnnotatedReturnType() {
         return getAnnotatedReturnType0(getDeclaringClass());
     }
--- a/src/share/classes/java/lang/reflect/Executable.java	Tue Mar 05 19:25:35 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Executable.java	Wed Mar 06 18:35:51 2013 +0100
@@ -476,6 +476,20 @@
         return declaredAnnotations;
     }
 
+    /**
+     * Returns an AnnotatedType object that represents the potentially
+     * annotated return type of the method/constructor represented by this
+     * Executable.
+     *
+     * If this Executable represents a constructor, the AnnotatedType object
+     * represents the type of the constructed object.
+     *
+     * If this Executable represents a method, the AnnotatedType object
+     * represents the use of a type to specify the return type of the method.
+     *
+     * @since 1.8
+     */
+    public abstract AnnotatedType getAnnotatedReturnType();
 
     /* Helper for subclasses of Executable.
      *
--- a/src/share/classes/java/lang/reflect/Method.java	Tue Mar 05 19:25:35 2013 +0100
+++ b/src/share/classes/java/lang/reflect/Method.java	Wed Mar 06 18:35:51 2013 +0100
@@ -629,6 +629,7 @@
      * {@inheritDoc}
      * @since 1.8
      */
+    @Override
     public AnnotatedType getAnnotatedReturnType() {
         return getAnnotatedReturnType0(getGenericReturnType());
     }