Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * @test /nodynamiccopyright/ |
aoqi@0 | 3 | * @bug 8028428 |
aoqi@0 | 4 | * @summary Test that only 'public' and 'abstract' elements compile |
aoqi@0 | 5 | * @compile/fail/ref=AnnotationTypeElementModifiers.out -XDrawDiagnostics AnnotationTypeElementModifiers.java |
aoqi@0 | 6 | */ |
aoqi@0 | 7 | |
aoqi@0 | 8 | public @interface AnnotationTypeElementModifiers { |
aoqi@0 | 9 | // First 4 should work |
aoqi@0 | 10 | public int A(); |
aoqi@0 | 11 | public int AA() default 1; |
aoqi@0 | 12 | |
aoqi@0 | 13 | abstract int B(); |
aoqi@0 | 14 | abstract int BB() default 1; |
aoqi@0 | 15 | |
aoqi@0 | 16 | // These shouldn't work |
aoqi@0 | 17 | private int C(); |
aoqi@0 | 18 | private int CC() default 1; |
aoqi@0 | 19 | |
aoqi@0 | 20 | protected int D(); |
aoqi@0 | 21 | protected int DD() default 1; |
aoqi@0 | 22 | |
aoqi@0 | 23 | static int E(); |
aoqi@0 | 24 | static int EE() default 1; |
aoqi@0 | 25 | |
aoqi@0 | 26 | final int F(); |
aoqi@0 | 27 | final int FF() default 1; |
aoqi@0 | 28 | |
aoqi@0 | 29 | synchronized int H(); |
aoqi@0 | 30 | synchronized int HH() default 1; |
aoqi@0 | 31 | |
aoqi@0 | 32 | volatile int I(); |
aoqi@0 | 33 | volatile int II() default 1; |
aoqi@0 | 34 | |
aoqi@0 | 35 | transient int J(); |
aoqi@0 | 36 | transient int JJ() default 1; |
aoqi@0 | 37 | |
aoqi@0 | 38 | native int K(); |
aoqi@0 | 39 | native int KK() default 1; |
aoqi@0 | 40 | |
aoqi@0 | 41 | strictfp float L(); |
aoqi@0 | 42 | strictfp float LL() default 0.1f; |
aoqi@0 | 43 | |
aoqi@0 | 44 | default int M(); |
aoqi@0 | 45 | default int MM() default 1; |
aoqi@0 | 46 | } |