Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.6
-
Component/s: class generator
-
Labels:None
-
Environment:Suse/Vista, Java6, Eclipse
-
Number of attachments :
Description
see original post here: http://www.nabble.com/POGO-properties-redefined-in-G1.0.3-tt17751775.html
In a class like:
import org.springframework.security.userdetails.UserDetails
class UserAccount implements UserDetails {
String username
String password
boolean accountNonExpired = true
boolean accountNonLocked = true
boolean credentialsNonExpired = true
/* other stuff */
}
I'm getting a compile error:
.grails\1.0.3\projects\wextent\generated-java-source\UserAccount.java:10: UserAccount is not abstract and does not override abstract method isCredentialsNonExpired() in org.springframework.security.userdetails.UserDetails
public class UserAccount
I assume that instead of isCredentialsNonExpired() for the property credentialsNonExpired the getCredentialsNonExpired() is generated.
As a hacky work-around I replaced the groovy-all-1.5.6.jar with the groovy-all-1.5.4.jar, but the issue shall be fixed officially, so that the improvements in groovy 1.5.6 are accessible in Grails 1.0.3
Issue Links
| This issue depends upon: | ||||
| GROOVY-2696 | Joint compiler does not honour JavaBean spec for boolean properties |
|
|
|
The way boolean getters are generated has changed in between 1.5.4 and 1.5.6. In 1.5.4 they were generated with "is" like isCredentialsNonExpired() now they are generated as "get" like getCredentialsNonExpired(). This is a breaking change.
As I mentioned before we should be generating both a "is" and a "get" if they don't already exist