JDK 8 code review request for 8014836: Have GenericDeclaration extend AnnotatedElement (original) (raw)

Joe Darcy joe.darcy at oracle.com
Mon May 20 21:10:13 UTC 2013


Hello,

Please review the patch below which implements

 8014836: Have GenericDeclaration extend AnnotatedElement

All the existing implementations of GenericDeclaration in the JDK already implement AnnotatedElement. Some code in java.lang.Class needed to be adjusted slightly since AnnotatedElement declares a default method and calling an interface's default method in an implementing class has to go through the direct interface type.

Thanks,

-Joe

--- a/src/share/classes/java/lang/Class.java Mon May 20 11:56:46 2013 -0700 +++ b/src/share/classes/java/lang/Class.java Mon May 20 14:07:15 2013 -0700 @@ -28,6 +28,7 @@ import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Array; import java.lang.reflect.GenericArrayType; +import java.lang.reflect.GenericDeclaration; import java.lang.reflect.Member; import java.lang.reflect.Field; import java.lang.reflect.Executable; @@ -115,9 +116,9 @@

@@ -3182,7 +3183,7 @@ */ @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {

GenericDeclaration.super.isAnnotationPresent(annotationClass); }

  /**

diff -r 6a9148865139 src/share/classes/java/lang/reflect/GenericDeclaration.java --- a/src/share/classes/java/lang/reflect/GenericDeclaration.java Mon May 20 11:56:46 2013 -0700 +++ b/src/share/classes/java/lang/reflect/GenericDeclaration.java Mon May 20 14:07:15 2013 -0700 @@ -1,5 +1,5 @@ /*



More information about the core-libs-dev mailing list