< prev index next >

test/java/lang/Class/GenericStringTest.java

Print this page

        

@@ -21,11 +21,11 @@
  * questions.
  */
 
 /*
  * @test
- * @bug 6298888 6992705
+ * @bug 6298888 6992705 8161500
  * @summary Check Class.toGenericString()
  * @author Joseph D. Darcy
  */
 
 import java.lang.reflect.*;

@@ -56,19 +56,15 @@
         // Type objects is being queried.
         failures += checkToGenericString(f.getType(), "java.util.Map<K,V>[]");
         f = GenericStringTest.class.getDeclaredField("mixed2");
         failures += checkToGenericString(f.getType(), "java.util.Map<K,V>[][]");
 
-        Class<?>[] types = {
-            GenericStringTest.class,
+        for(Class<?> clazz : List.of(GenericStringTest.class,
             AnInterface.class,
             LocalMap.class,
             AnEnum.class,
-            AnotherEnum.class,
-        };
-
-        for(Class<?> clazz : types) {
+                                     AnotherEnum.class)) {
             failures += checkToGenericString(clazz, clazz.getAnnotation(ExpectedGenericString.class).value());
         }
 
         if (failures > 0) {
             throw new RuntimeException();
< prev index next >