当我尝试使用最新的grails snapshoot编译附加的groovy类时,我收到以下异常。我今天关闭了构建服务器。异常中的关键注释是:如果这不是您自己的做法,请将此错误报告给转换的编写者。
例外:
/u01/workspace/grails/grails-spring-social-core/grails-app/domain/grails/plugins/springsocial/UserConnection.groovy:-1: 转换使用包含ClassNode grails.plugins.springsocial.UserConnection的泛型 方法public static grails.plugins.springsocial.UserConnection create(){...}
直。你不应该这样做。请创建一个新的 ClassNode引用旧的ClassNode并使用新的ClassNode 旧的。否则编译器将创建错误的描述符和a OpenJDK中TypeResolver中潜在的NullPointerException。如果是这样的话 不是你自己做的,请把这个bug报告给变换的作者。
所以这看起来像是一些报告的grails错误,但是他们被解雇为插件中的错误。这是一个Grails问题还是一个常规问题?
这谈到这可能是一个时髦的错误...但这是我的头脑。
http://comments.gmane.org/gmane.comp.lang.groovy.devel/26130
这是什么原因?再次这是grails转换的问题还是这是一个常规的编译器异常?我正在尝试编译以下类:
package grails.plugins.springsocial
import groovy.transform.EqualsAndHashCode
@EqualsAndHashCode(includeFields=true)
class UserConnection implements Serializable {
String userId
String providerId
String providerUserId
String displayName
String profileUrl
String imageUrl
String accessToken
String secret
String refreshToken
Long rank
Long expireTime
static constraints = {
userId nullable: false
providerId nullable: false
providerUserId nullable: false
displayName nullable: true
profileUrl nullable: true
imageUrl nullable: true
accessToken nullable: false
secret nullable: true
refreshToken nullable: true
rank nullable: false
expireTime nullable: true
}
static mapping = {
table "UserConnection"
version false
id composite:['userId', 'providerId', 'providerUserId']
userId column:'userId',length:64
providerId column:'providerId',length:128
providerUserId column:'providerUserId',length:128
displayName column:'displayName'
profileUrl column:'profileUrl'
imageUrl column:'imageUrl'
accessToken column:'accessToken'
secret column:'secret'
refreshToken column:'refreshToken'
rank column:'rank'
expireTime column:'expireTime'
}
}
感谢您的帮助!
答案 0 :(得分:0)
这最终成为Groovy 1.8.3问题。我降级到1.8.2,不再有问题。