Skip to content

GROOVY-11907: SC: trait static field helper generates invalid bytecod…#2443

Open
paulk-asert wants to merge 1 commit intoapache:GROOVY_5_0_Xfrom
paulk-asert:groovy11907
Open

GROOVY-11907: SC: trait static field helper generates invalid bytecod…#2443
paulk-asert wants to merge 1 commit intoapache:GROOVY_5_0_Xfrom
paulk-asert:groovy11907

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

…e when method-level DYNAMIC_RESOLUTION is present (GROOVY-11817 regression)

…e when method-level DYNAMIC_RESOLUTION is present (GROOVY-11817 regression)
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.1304%. Comparing base (9941325) to head (0179f9b).
⚠️ Report is 1 commits behind head on GROOVY_5_0_X.

Files with missing lines Patch % Lines
...oovy/transform/trait/TraitReceiverTransformer.java 66.6667% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                   @@
##             GROOVY_5_0_X      #2443        +/-   ##
======================================================
- Coverage         67.1318%   67.1304%   -0.0014%     
+ Complexity          29431      29430         -1     
======================================================
  Files                1382       1382                
  Lines              116800     116804         +4     
  Branches            20473      20474         +1     
======================================================
+ Hits                78410      78411         +1     
+ Misses              31905      31904         -1     
- Partials             6485       6489         +4     
Files with missing lines Coverage Δ
...oovy/transform/trait/TraitReceiverTransformer.java 88.8889% <66.6667%> (-0.8408%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jamesfredley added a commit to apache/grails-core that referenced this pull request Apr 6, 2026
Groovy 5.0.4+ bundles ASM 9.9.1 which rejects the invalid bytecode
generated by TraitReceiverTransformer for @CompileStatic traits with
static fields when method-level DYNAMIC_RESOLUTION is present
(GROOVY-11907, a regression from GROOVY-11817).

The only affected trait in grails-geb testFixtures is ContainerSupport
(static fields: container, downloadSupport). Switch it from
@CompileStatic to @CompileDynamic so its helper class compiles via
the dynamic code path, which generates valid bytecode. ContainerGebSpec
retains @CompileStatic - its delegate stubs are simple forwarding calls
unaffected by the bug.

This unblocks the Groovy 5.0.3 -> 5.0.5 upgrade. Revert to
@CompileStatic once the Groovy fix (apache/groovy#2443) ships.

Assisted-by: Claude Code <Claude@Claude.ai>
@paulk-asert paulk-asert requested a review from eric-milles April 7, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants