Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
4.0.22
-
None
Description
I have a POJO that I use from Groovy code. After adding a setter overload, I now get IncompatibleClassChange at runtime because the static compiler generates ScriptBytecodeAdapter.setGroovyObjectProperty instead of a plain setter call.
public class Entity { public void setId(String id) {} public void setId(UUID id) {} } class EntityTest extends Specification { @CompileStatic Entity createEntity(String id) { new Entity(id: id) // uses ScriptBytecodeAdapter.setGroovyObjectProperty } }
The error is not encountered when calling setId(id) or using entity.id = id, without static compilation, or when the setter is not overloaded.
Attachments
Issue Links
- is related to
-
GROOVY-11119 String and Pattern conflict
- Closed