To: ###@###.###
From: <###@###.###>
Subject: [metadata-jsr] Clarifications for dimensions in the AnnotationTypeMemberDeclaration
Hi,
The latest version of javac (javac 1.5.0-beta2/build 1.5.0-beta2-b42)
accepts this code:
@interface Name {
String first()[];
String last();
}
In the public draft, I can read:
AbstractMethodModifiersopt Type Identifier ( ) DefaultValueopt ;
This means that the [] are illegal. The only possible tokens after ')' are
'default' or ';'.
The rule should be written like this, if you want to allow the brackets.
AbstractMethodModifiersopt Type Identifier ( ) Dimsopt DefaultValueopt ;
Could you please let me know if the specs will be updated to reflect the
rule above or if this is a bug in the compiler? The code could easily be
fixed like this:
@interface Name {
String[] first();
String last();
}