Description
Compiler is not consistent with spec about InterfaceMethodModifiers in annotations
JSR335 spec says:
9.6.1 Annotation Type Elements
AnnotationTypeElementDeclaration:
AbstractMethodModifiersopt InterfaceMethodModifiersopt
Type Identifier '(' ')' Dimsopt DefaultValueopt ';'
Here is the example of inconsistencies:
@interface Annot {
static int m1(); //should not fail
default int m2(); //should not fail
static int m3() {return 0;} //should fail
default int m4() {return 0;} //should fail
}
The following JCK tests fail:
lang/ANNOT/annot141/annot14101m11/annot14101m11.html
lang/ANNOT/annot141/annot14101m1/annot14101m1.html
lang/ANNOT/annot141/annot14101m0/annot14101m0.html
lang/ANNOT/annot141/annot14101m01/annot14101m01.html
lang/ANNOT/annot141/annot14102m0/annot14102m0.html
lang/ANNOT/annot141/annot14102m01/annot14102m01.html
lang/ANNOT/annot141/annot14101ma/annot14101ma.html
lang/ANNOT/annot141/annot14101ma1/annot14101ma1.html
lang/ANNOT/annot141/annot14101mc/annot14101mc.html
lang/ANNOT/annot141/annot14101mc1/annot14101mc1.html
lang/ANNOT/annot141/annot14101md/annot14101md.html
lang/ANNOT/annot141/annot14101mb/annot14101mb.html
lang/ANNOT/annot141/annot14101md1/annot14101md1.html
lang/ANNOT/annot141/annot14101mb1/annot14101mb1.html
lang/ANNOT/annot141/annot14102m2/annot14102m2.html
lang/ANNOT/annot141/annot14102m21/annot14102m21.html
lang/ANNOT/annot141/annot14102m3/annot14102m3.html
lang/ANNOT/annot141/annot14102m31/annot14102m31.html
lang/ANNOT/annot141/annot14101ma/annot14101ma_rt.html
lang/ANNOT/annot141/annot14101ma1/annot14101ma1_rt.html
lang/ANNOT/annot141/annot14101mc/annot14101mc_rt.html
lang/ANNOT/annot141/annot14101mc1/annot14101mc1_rt.html
lang/ANNOT/annot141/annot14101md/annot14101md_rt.html
lang/ANNOT/annot141/annot14101mb/annot14101mb_rt.html
lang/ANNOT/annot141/annot14101md1/annot14101md1_rt.html
lang/ANNOT/annot141/annot14101mb1/annot14101mb1_rt.html
lang/ANNOT/annot141/annot14102m2/annot14102m2_rt.html
lang/ANNOT/annot141/annot14102m21/annot14102m21_rt.html
lang/ANNOT/annot141/annot14102m3/annot14102m3_rt.html
lang/ANNOT/annot141/annot14102m31/annot14102m31_rt.html
JSR335 spec says:
9.6.1 Annotation Type Elements
AnnotationTypeElementDeclaration:
AbstractMethodModifiersopt InterfaceMethodModifiersopt
Type Identifier '(' ')' Dimsopt DefaultValueopt ';'
Here is the example of inconsistencies:
@interface Annot {
static int m1(); //should not fail
default int m2(); //should not fail
static int m3() {return 0;} //should fail
default int m4() {return 0;} //should fail
}
The following JCK tests fail:
lang/ANNOT/annot141/annot14101m11/annot14101m11.html
lang/ANNOT/annot141/annot14101m1/annot14101m1.html
lang/ANNOT/annot141/annot14101m0/annot14101m0.html
lang/ANNOT/annot141/annot14101m01/annot14101m01.html
lang/ANNOT/annot141/annot14102m0/annot14102m0.html
lang/ANNOT/annot141/annot14102m01/annot14102m01.html
lang/ANNOT/annot141/annot14101ma/annot14101ma.html
lang/ANNOT/annot141/annot14101ma1/annot14101ma1.html
lang/ANNOT/annot141/annot14101mc/annot14101mc.html
lang/ANNOT/annot141/annot14101mc1/annot14101mc1.html
lang/ANNOT/annot141/annot14101md/annot14101md.html
lang/ANNOT/annot141/annot14101mb/annot14101mb.html
lang/ANNOT/annot141/annot14101md1/annot14101md1.html
lang/ANNOT/annot141/annot14101mb1/annot14101mb1.html
lang/ANNOT/annot141/annot14102m2/annot14102m2.html
lang/ANNOT/annot141/annot14102m21/annot14102m21.html
lang/ANNOT/annot141/annot14102m3/annot14102m3.html
lang/ANNOT/annot141/annot14102m31/annot14102m31.html
lang/ANNOT/annot141/annot14101ma/annot14101ma_rt.html
lang/ANNOT/annot141/annot14101ma1/annot14101ma1_rt.html
lang/ANNOT/annot141/annot14101mc/annot14101mc_rt.html
lang/ANNOT/annot141/annot14101mc1/annot14101mc1_rt.html
lang/ANNOT/annot141/annot14101md/annot14101md_rt.html
lang/ANNOT/annot141/annot14101mb/annot14101mb_rt.html
lang/ANNOT/annot141/annot14101md1/annot14101md1_rt.html
lang/ANNOT/annot141/annot14101mb1/annot14101mb1_rt.html
lang/ANNOT/annot141/annot14102m2/annot14102m2_rt.html
lang/ANNOT/annot141/annot14102m21/annot14102m21_rt.html
lang/ANNOT/annot141/annot14102m3/annot14102m3_rt.html
lang/ANNOT/annot141/annot14102m31/annot14102m31_rt.html
Attachments
Issue Links
- is blocked by
-
JDK-8014487 Lambda Spec: static and default methods in annotation type declarations
- Closed
- relates to
-
JDK-8014487 Lambda Spec: static and default methods in annotation type declarations
- Closed