The GitHub Actions job "Code Style" on grails-core.git/grails8-groovy6-canary 
has failed.
Run started by GitHub user jamesfredley (triggered by jamesfredley).

Head commit for run:
0dcb65294ca9f011358145e8766450235b1a2165 / James Fredley 
<[email protected]>
fix: Groovy 6 genericGetMethod regression breaks property access on GORM 
entities

Groovy 6 registers GormEntity.get(Serializable) as the genericGetMethod
in MetaClassImpl, causing dynamic property access like Entity.name to
call get("name") instead of Class.getName(). This breaks all property
access on @Entity classes that goes through Groovy's dynamic dispatch.

Root cause: Groovy 6 relaxed MetaClassImpl.isGenericGetMethod from
requiring get(String) to accepting get(Serializable), which matches
GormEntity's static get(Serializable) method. Confirmed by runtime
metaclass inspection showing genericGetMethod set to get(Serializable).

Fix: add a get(String) overload to GormEntity that intercepts the
genericGetMethod calls. When the argument matches a java.lang.Class
bean property (name, simpleName, etc.), it delegates to Class.class
metaclass. Otherwise it delegates to the GORM static API as before.

Also guard staticPropertyMissing with the same Class property check
for belt-and-suspenders coverage of the Groovy 6 property resolution
change.

Assisted-by: Claude Code <[email protected]>

Report URL: https://github.com/apache/grails-core/actions/runs/24034917900

With regards,
GitHub Actions via GitBox

Reply via email to