Good annotations in groovy class marked red
the following annotations compile and work correctly but are marked as invalid with "Expression expected" in IDEA
@ValidateNestedProperties([
@Validate(field="username", required=true, on=["save"], minlength=3, maxlength=20),
@Validate(field="password", required=true, on=["save"], minlength=5, maxlength=20),
@Validate(field="email", required=true, on=["save"], minlength=5, maxlength=20),
])
UserBean user
Please sign in to leave a comment.
Actually this a bug with groovy syntax spec at http://groovy.codehaus.org/jsr/spec/grammar/#annotation. We went out of our usual way of behaving according to the spec and corrected this in jetgroovy 1.5 (i.e. trunk) The build will be available in the nearest days.
Eugene.
No, this should not be valid: this is a result of a closure being parsed in groovy - but that is probably not what you want, use curly braces instead.
Eugene.
I'm not sure what you mean... curly braces instead of the square brackets? the code compiles and acts as expected..
Yes, I consulted groovy devs, and they say the switch from java-style curly braces to squares ones was made intentionally.
cool.
So this should be fixed in 1.5?
Yes, indeed.