Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.7
-
Fix Version/s: 1.5.8
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
With Java 5, annotation parameters of array type have a shortcut notation of the case where there's just one value.
For instance, with javax.persistence.OneToMany, instead of writing this:
@OneToMany(cascade = { CascadeType.ALL })
You can write this:
@OneToMany(cascade = CascadeType.ALL)
Groovy uses square brackets instead of curly braces, for one difference, but it also doesn't allow to omit the brackets.
So the idea of this ticket is we should support this shorcut notation without the surrounding brackets/braces.
Issue Links
| This issue is related to: | ||||
| GROOVY-2679 | Allow to omit square brackets in annotations when list has just one element (similar to Java) |
|
|
|
The problem was solved for 1.6, as part of the work on annotation definition and other improvements, but was not backported to 1.5