Description
Given the annotation type:
@interface Foo { int[] value(); }
javac fails to, but should, parse an annotation @Foo({,}) - that is, a single comma as the value of the array which is assigned to Foo's "value" element.
Accepting not merely a trailing comma but a single comma was the clear intent of JLS 9.7.1 "Normal annotations". It aligns with array initializers for variable declarations, where "int[] x = {,}" is accepted.
@interface Foo { int[] value(); }
javac fails to, but should, parse an annotation @Foo({,}) - that is, a single comma as the value of the array which is assigned to Foo's "value" element.
Accepting not merely a trailing comma but a single comma was the clear intent of JLS 9.7.1 "Normal annotations". It aligns with array initializers for variable declarations, where "int[] x = {,}" is accepted.
Attachments
Issue Links
- relates to
-
JDK-7080366 Grammar bugs in JLS7
- Closed