Repository navigation
GROOVY-12591: create the GString adapter of a method reference without ACC_FINAL in an interface - #3116
Closed
codeconsole wants to merge 1 commit into
Closed
GROOVY-12591: create the GString adapter of a method reference without ACC_FINAL in an interface#3116codeconsole wants to merge 1 commit into
codeconsole wants to merge 1 commit into
Conversation
…t ACC_FINAL in an interface The JVM rejects ACC_FINAL on any method of an interface (JVMS 4.6), so an interface with a statically compiled method reference taking a String failed to load with ClassFormatError. The other helper methods of method references already leave it out there.
This was referenced Oct 31, 2026
Merged
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3116 +/- ##
==================================================
+ Coverage 73.7672% 74.1056% +0.3385%
- Complexity 42748 43593 +845
==================================================
Files 1678 1692 +14
Lines 147464 149237 +1773
Branches 27899 28282 +383
==================================================
+ Hits 108780 110593 +1813
+ Misses 28523 28473 -50
- Partials 10161 10171 +10
🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 66edd8d Learn more about TestLens at testlens.app/docs. |
Contributor
Author
|
Closing: @paulk-asert made the same change on master in b76142b (GROOVY-12536), together with the update to the GROOVY-12488 interface test, so master is green again and this PR has nothing left to add. Thanks, Paul. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master fails to load an interface with a statically compiled method reference that takes a
String, andMethodReferenceTest.testMethodReferencesInStaticAndDefaultMethodsOfInterfacefails on every JDK since #3056 was merged:GROOVY-12536 (#3056) adds a synthetic adapter that converts a
GStringargument toString, createdprivate static final. The JVM rejectsACC_FINALon an interface method (JVMS 4.6). The other helper methods of method references leave it out in interfaces since GROOVY-12488 (#3022); the adapter now does the same.testMethodReferencesInStaticAndDefaultMethodsOfInterfacealso lists the helper methods of the interface, and now expects thegstringadapters there.Tests
MethodReferenceTest.testMethodReferenceTakingStringInInterface(aGStringelement throughString::lengthin a static interface method andString::trimin a default method) andtestMethodReferencesInStaticAndDefaultMethodsOfInterfacefail without the change;MethodReferenceTestpasses. The Checkstyle and CodeNarc gates pass.