当我为Spring Security运行s2-quickstart时,它生成的域类称为默认构造函数,而Intellij 14正在抱怨Recursive Constructor Invocation
。 Grails运行良好,但我怎么说服IntelliJ一切正常?
另外,出于好奇,为什么这些构造函数一直存在?我通常更喜欢使用Groovy开箱即用的默认或地图构造函数。这是可以删除的东西吗?
package com.company.product
import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString
@EqualsAndHashCode(includes = 'authority')
@ToString(includes = 'authority', includeNames = true, includePackage = false)
class Role implements Serializable {
private static final long serialVersionUID = 1
String authority
Role(String authority) {
this()
this.authority = authority
}
static constraints = {
authority blank: false, unique: true
}
static mapping = {
cache true
}
}