Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.4.0
-
None
-
OSX Yosemite
Description
Overloading a getter from a super class and then delegating to that parent class requires using the actual method and not the property accessor when using static compilation in groovy 2.4.0. This is something we do to add hibernate validators to a subclass of generated code. Not using static compilation on the subclass or switching to groovy 2.3.x resolves the issue.
import groovy.transform.CompileStatic class A { private String field1 = 'test' String getField1() { return this.field1 } } @CompileStatic class B extends A { @Override String getField1() { super.field1 } } B b = new B() println b.field1
>>> 2.4.0 output
Exception thrown
java.lang.StackOverflowError at B.getField1(ConsoleScript1:15) at B.getField1(ConsoleScript1:15) at B.getField1(ConsoleScript1:15)
>>> 2.3.6 output
test
Attachments
Issue Links
- relates to
-
GROOVY-10707 Regression in property access for conflicting isXxx and getXxx accessors
- Closed
-
GROOVY-10708 Property access for wrapped vs. primitive boolean
- Closed