Hi,
In groovy 4 i am able to do this:
I used to be able to do this:
@Override
void setProperty(String propertyName, Object newValue) {
if (propertyName in columnNames) {
putAt(propertyName, newValue)
} else {
super.setProperty(propertyName, newValue)
}
}
The class is annotated with @CompileStatic
When compiling that with groovy 5 (Gradle 8.14.3, JVM: 21.0.6) i get
the following error:.../Row.groovy: 60: [Static type checking] - Default
method setProperty(java.lang.String, java.lang.Object) requires
qualified super @ line 60, column 13. super.setProperty(propertyName,
newValue)
A possible workaround is to qualify the super reference:
@Override void setProperty(String propertyName, Object newValue) {
if (propertyNamein columnNames) {
putAt(propertyName, newValue)
}else {
GroovyObject.super.setProperty(propertyName, newValue)
}
}
Is that the recommended way to refer to the DefaultGroovyMethods
setProperty if i cannot use super directly in groovy 5 using static
compilation?
Regards,
Per