IntelliJ IDEA reporting possibly-erroneous error in Grails domain class.

Answered

In the mapping closure of a Grails domain class

@GrailsCompileStatic
class SampleClass {

Foo foo
Bar bar
static constraints = {
foo nullable: false
bar nullable: false
}
static mapping = {
id composite: ['foo', 'bar']
version false
}
}

Intellij highlights 'version false' as an error with the message: 'version' cannot be applied to '(java.lang.Boolean)'. However, I believe this is the correct way to disable optimistic locking. If I remove the @GrailsCompileStatic annotation, the error goes away. In either case, the code compiles and runs as expected. Is there something I'm missing? Do I need to configure IntelliJ with what to ignore as errors for the GrailsCompileStatic annotation?

I'm running with Grails 3.3.9 on

IntelliJ IDEA 2018.3.5 (Ultimate Edition)
Build #IU-183.5912.21, built on February 26, 2019
JRE: 1.8.0_152-release-1343-b28 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

5
4 comments

We are having the same issue.

 

 

0
Avatar
Permanently deleted user

Still an issue w/ Grails 4+ and IntelliJ Ultimate 2019.3.1

0

Still and issue in v2019.3.2

IntelliJ IDEA 2019.3.2 (Ultimate Edition)
Build #IU-193.6015.39, built on January 20, 2020

0

Please sign in to leave a comment.