test/tools/javac/annotations/AnnotationTypeElementModifiers.java

Wed, 14 Nov 2018 10:18:25 -0800

author
diazhou
date
Wed, 14 Nov 2018 10:18:25 -0800
changeset 3762
7909abb85562
parent 0
959103a6100f
permissions
-rw-r--r--

Added tag jdk8u201-b04 for changeset a7f48b9dfb82

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 8028428
     4  * @summary Test that only 'public' and 'abstract' elements compile
     5  * @compile/fail/ref=AnnotationTypeElementModifiers.out -XDrawDiagnostics AnnotationTypeElementModifiers.java
     6  */
     8 public @interface AnnotationTypeElementModifiers {
     9     // First 4 should work
    10     public int A();
    11     public int AA() default  1;
    13     abstract int B();
    14     abstract int BB() default  1;
    16     // These shouldn't work
    17     private int C();
    18     private int CC() default  1;
    20     protected int D();
    21     protected int DD() default  1;
    23     static int E();
    24     static int EE() default  1;
    26     final int F();
    27     final int FF() default  1;
    29     synchronized int H();
    30     synchronized int HH() default  1;
    32     volatile int I();
    33     volatile int II() default  1;
    35     transient int J();
    36     transient int JJ() default  1;
    38     native int K();
    39     native int KK() default  1;
    41     strictfp float L();
    42     strictfp float LL() default  0.1f;
    44     default int M();
    45     default int MM() default  1;
    46 }

mercurial