< prev index next >

test/java/lang/reflect/Field/GenericStringTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

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

@@ -33,16 +33,12 @@
 import java.util.*;
 
 public class GenericStringTest {
     public static void main(String argv[]) throws Exception {
         int failures = 0;
-        List<Class> classList = new LinkedList<Class>();
-        classList.add(TestClass1.class);
-        classList.add(TestClass2.class);
 
-
-        for(Class clazz: classList)
+        for(Class clazz: List.of(TestClass1.class, TestClass2.class))
             for(Field field: clazz.getDeclaredFields()) {
                 ExpectedString es = field.getAnnotation(ExpectedString.class);
                 String genericString = field.toGenericString();
                 System.out.println(genericString);
                 if (! es.value().equals(genericString)) {
< prev index next >