GROOVY-12134: @Delegate regression: fails to skip a final method inhe…#2670
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Fixes a regression in @Delegate method generation where final methods inherited from precompiled (binary) superclasses were not being properly skipped.
Changes:
- Adjust delegate-method generation to avoid overwriting inherited implementations from precompiled classes when the AST has no method body.
- Add regression tests covering final methods inherited from JDK classes and Groovy-compiled classes loaded from the classpath.
- Update an existing test case to assert successful compilation where the owner’s generic signature should take precedence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/test/groovy/org/codehaus/groovy/transform/DelegateTransformTest.groovy | Adds regression coverage for inherited final methods from precompiled and classpath-loaded superclasses. |
| src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java | Refines overwrite condition to distinguish “bodiless placeholder” methods from real inherited implementations. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2670 +/- ##
==================================================
+ Coverage 68.5684% 68.6972% +0.1288%
- Complexity 33800 34121 +321
==================================================
Files 1524 1536 +12
Lines 128091 128912 +821
Branches 23283 23368 +85
==================================================
+ Hits 87830 88559 +729
- Misses 32467 32522 +55
- Partials 7794 7831 +37
🚀 New features to boost your workflow:
|
|
I assume the test failure is due to test flakiness? |
…rited from a precompiled superclass
🚨 TestLens detected 1 failed test 🚨Here is what you can do:
Test SummaryBuild and test / lts (17, ubuntu-latest) > :groovy-json:test
🏷️ Commit: 19d37db Test FailuresGroovy9802 > test() (:groovy-json:test in Build and test / lts (17, ubuntu-latest))Muted TestsNote Checks are currently running using the configuration below. Select tests to mute in this pull request: 🔲 Groovy9802 > test() Reuse successful test results: 🔲 ♻️ Only rerun the tests that failed or were muted before Click the checkbox to trigger a rerun: 🔲 Rerun jobs Learn more about TestLens at testlens.app. |
…rited from a precompiled superclass