test/tools/javac/6520152/T6520152.java

Wed, 23 Jan 2013 13:27:24 -0800

author
jjg
date
Wed, 23 Jan 2013 13:27:24 -0800
changeset 1521
71f35e4b93a5
parent 0
959103a6100f
permissions
-rw-r--r--

8006775: JSR 308: Compiler changes in JDK8
Reviewed-by: jjg
Contributed-by: mernst@cs.washington.edu, wmdietl@cs.washington.edu, mpapi@csail.mit.edu, mahmood@notnoop.com

     1 /**
     2  * @test
     3  * @bug     6520152
     4  * @summary ACC_FINAL flag for anonymous classes shouldn't be set
     5  * @compile T.java
     6  * @run main/othervm T6520152
     7  */
     9 import java.lang.reflect.Method;
    10 import static java.lang.reflect.Modifier.*;
    12 public class T6520152 {
    13     public static void main(String [] args) throws Exception {
    14         Class clazz = Class.forName("T$1");
    15         if ((clazz.getModifiers() & FINAL) != 0) {
    16             throw new RuntimeException("Failed: " + clazz.getName() + " shouldn't be marked final.");
    17         }
    18     }
    19 }

mercurial