< prev index next >

test/jdk/java/lang/Class/GenericStringTest.java

Print this page
*** 1,7 ***
  /*
!  * 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.
--- 1,7 ---
  /*
!  * 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.

*** 24,10 ***
--- 24,13 ---
  /*
   * @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.*;

*** 68,11 ***
  
          for(Class<?> clazz : List.of(GenericStringTest.class,
                                       AnInterface.class,
                                       LocalMap.class,
                                       AnEnum.class,
!                                      AnotherEnum.class)) {
              failures += checkToGenericString(clazz, clazz.getAnnotation(ExpectedGenericString.class).value());
          }
  
          if (failures > 0) {
              throw new RuntimeException();
--- 71,12 ---
  
          for(Class<?> clazz : List.of(GenericStringTest.class,
                                       AnInterface.class,
                                       LocalMap.class,
                                       AnEnum.class,
!                                      AnotherEnum.class,
+                                      AValueClass.class)) {
              failures += checkToGenericString(clazz, clazz.getAnnotation(ExpectedGenericString.class).value());
          }
  
          if (failures > 0) {
              throw new RuntimeException();

*** 109,5 ***
--- 113,8 ---
  
  @ExpectedGenericString("enum AnotherEnum")
  enum AnotherEnum {
      BAR{};
  }
+ 
+ @ExpectedGenericString("final value class AValueClass<E>")
+ value class AValueClass<E> {}
< prev index next >