groovy

Shortcut notation for annotations for single value array parameter

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.7
  • Fix Version/s: 1.5.8
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

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

Activity

Hide
Guillaume Laforge added a comment - - edited

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

Show
Guillaume Laforge added a comment - - edited 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

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: