Name: rmT116609 Date: 02/09/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)
A DESCRIPTION OF THE PROBLEM :
in the jsr175 spec (metadata-1_0-prd-spec/metadata-public-draft.html), the AnnotationTypeMemberDeclaration production allows:
ConstantDeclaration
ClassDeclaration
InterfaceDeclaration
EnumDeclaration
AnnotationTypeDeclaration
but the compile doesn't want to seem to have a bar of it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile the following code
ERROR MESSAGES/STACK TRACES THAT OCCUR :
foo\metadata\Annot2.java:6: an @interface may not contain a type declaration
public class InnerClass
^
foo\metadata\Annot2.java:13: an @interface may not contain a type declaration
public enum InnerEnum {
^
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package foo.metadata;
public @interface Annot2 {
String value();
public class InnerClass
{
public void foo() {
System.out.println("Annot2.InnerClass.foo");
}
}
public enum InnerEnum {
RED, GREEN, BLUE;
public void foo() {
System.out.println("Annot2.InnerEnum.foo");
}
}
}
---------- END SOURCE ----------
(Incident Review ID: 238054)
======================================================================
- duplicates
-
JDK-4981309 bring jsr175 implementation up to date with Public Draft
- Resolved