Skip to content

GROOVY-12235: Interface default method without dynamic calls referenc… - #2767

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12235
Aug 6, 2026
Merged

GROOVY-12235: Interface default method without dynamic calls referenc…#2767
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12235

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

…es unemitted call-site helper under indy=false

…es unemitted call-site helper under indy=false

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a non-invokedynamic (indy=false) bytecode generation edge case for interfaces where a call-site array prologue is emitted even when no call sites are registered, which could otherwise lead to NoClassDefFoundError at first invocation.

Changes:

  • Track whether the call-site array prologue was emitted during class generation.
  • Ensure the interface helper class is materialized whenever a prologue was emitted (not only when call sites were recorded).
  • Add regression tests covering interface default and static methods with trivial bodies under indy=false.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/test/groovy/bugs/Groovy12235.groovy Adds regression tests for interface default/static methods returning null under indy=false.
src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java Switches interface-helper materialization condition to depend on whether a call-site prologue was emitted.
src/main/java/org/codehaus/groovy/classgen/asm/CallSiteWriter.java Adds a prologueEmitted flag and accessor to indicate whether the call-site prologue was generated for the class.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.9836%. Comparing base (2f85f42) to head (37a37ff).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2767        +/-   ##
==================================================
- Coverage     69.9869%   69.9836%   -0.0033%     
  Complexity      35529      35529                
==================================================
  Files            1557       1557                
  Lines          131686     131688         +2     
  Branches        24174      24173         -1     
==================================================
- Hits            92163      92160         -3     
- Misses          31189      31191         +2     
- Partials         8334       8337         +3     
Files with missing lines Coverage Δ
...rg/codehaus/groovy/classgen/AsmClassGenerator.java 84.7129% <100.0000%> (ø)
...g/codehaus/groovy/classgen/asm/CallSiteWriter.java 86.6667% <100.0000%> (+0.1282%) ⬆️

... 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.

@testlens-app

testlens-app Bot commented Aug 5, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 37a37ff
▶️ Tests: 108821 executed
⚪️ Checks: 31/31 completed


Learn more about TestLens at testlens.app.

@paulk-asert
paulk-asert merged commit ce9687c into apache:master Aug 6, 2026
32 checks passed
@paulk-asert
paulk-asert deleted the groovy12235 branch August 6, 2026 22:34
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.

3 participants