jdk/src/share/classes/java/lang/Class.java
changeset 19588 5f7c7cdd74e9
parent 19031 6c9afe6dad33
child 19819 a2cde5f9a3d6
child 20849 1deb5d315831
--- a/jdk/src/share/classes/java/lang/Class.java	Sun Aug 25 23:20:59 2013 +0400
+++ b/jdk/src/share/classes/java/lang/Class.java	Mon Aug 26 13:38:14 2013 +0200
@@ -3338,8 +3338,16 @@
      * @since 1.8
      */
     public AnnotatedType getAnnotatedSuperclass() {
-         return TypeAnnotationParser.buildAnnotatedSuperclass(getRawTypeAnnotations(), getConstantPool(), this);
-}
+        if (this == Object.class ||
+                isInterface() ||
+                isArray() ||
+                isPrimitive() ||
+                this == Void.TYPE) {
+            return null;
+        }
+
+        return TypeAnnotationParser.buildAnnotatedSuperclass(getRawTypeAnnotations(), getConstantPool(), this);
+    }
 
     /**
      * Returns an array of AnnotatedType objects that represent the use of types to