langtools/test/tools/javac/6520152/T6520152.java
author hseigel
Wed, 02 Mar 2016 23:48:41 +0000
changeset 36397 c487ced7231c
parent 10 06bc494ca11e
child 37633 d16d6d59446d
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * @test
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug     6520152
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary ACC_FINAL flag for anonymous classes shouldn't be set
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @compile T.java
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * @run main/othervm T6520152
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
import java.lang.reflect.Method;
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
import static java.lang.reflect.Modifier.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
public class T6520152 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
    public static void main(String [] args) throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
        Class clazz = Class.forName("T$1");
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        if ((clazz.getModifiers() & FINAL) != 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
            throw new RuntimeException("Failed: " + clazz.getName() + " shouldn't be marked final.");
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
}