< prev index next > test/jdk/java/lang/Class/GenericStringTest.java
Print this page
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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.
/*
* @test
* @bug 6298888 6992705 8161500 6304578
* @summary Check Class.toGenericString()
* @author Joseph D. Darcy
+ * @enablePreview
+ * @compile GenericStringTest.java
+ * @run main/othervm GenericStringTest
*/
import java.lang.reflect.*;
import java.lang.annotation.*;
import java.util.*;
for(Class<?> clazz : List.of(GenericStringTest.class,
AnInterface.class,
LocalMap.class,
AnEnum.class,
- AnotherEnum.class)) {
+ AnotherEnum.class,
+ AValueClass.class)) {
failures += checkToGenericString(clazz, clazz.getAnnotation(ExpectedGenericString.class).value());
}
if (failures > 0) {
throw new RuntimeException();
@ExpectedGenericString("enum AnotherEnum")
enum AnotherEnum {
BAR{};
}
+
+ @ExpectedGenericString("final value class AValueClass<E>")
+ value class AValueClass<E> {}
< prev index next >