< prev index next >
test/java/lang/Class/GenericStringTest.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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 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 >