test/java/lang/annotation/TypeAnnotationReflection.java

Print this page
rev 7916 : 8022343: j.l.Class.getAnnotatedSuperclass() doesn't return null in some cases
Reviewed-by: darcy, vromero, psandoz

@@ -21,11 +21,11 @@
  * questions.
  */
 
 /*
  * @test
- * @bug 8004698 8007073
+ * @bug 8004698 8007073 8022343
  * @summary Unit test for type annotations
  */
 
 import java.util.*;
 import java.lang.annotation.*;

@@ -56,11 +56,11 @@
         if (!b)
             throw new RuntimeException();
     }
 
     private static void testSuper() throws Exception {
-        check(Object.class.getAnnotatedSuperclass().getAnnotations().length == 0);
+        check(Object.class.getAnnotatedSuperclass() == null);
         check(Class.class.getAnnotatedSuperclass().getAnnotations().length == 0);
 
         AnnotatedType a;
         a = TestClassArray.class.getAnnotatedSuperclass();
         Annotation[] annos = a.getAnnotations();