[
https://issues.apache.org/jira/browse/GROOVY-12591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135523#comment-18135523
]
ASF GitHub Bot commented on GROOVY-12591:
-----------------------------------------
testlens-app[bot] commented on PR #3116:
URL: https://github.com/apache/groovy/pull/3116#issuecomment-6537552987
## ✅ All tests passed ✅
🏷️ Commit: 66edd8d8099950f5fd8e8cfff311a96ba3b9ca5f
▶️ Tests: 109451 executed
⚪️ Checks: 26/26 completed
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> SC: a method reference in an interface fails to load with ClassFormatError:
> the GString adapter method is final
> ---------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12591
> URL: https://issues.apache.org/jira/browse/GROOVY-12591
> Project: Groovy
> Issue Type: Bug
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> On master, a statically compiled method or constructor reference with a
> String parameter inside an interface makes the interface fail to load:
> {code:groovy}
> @groovy.transform.CompileStatic
> interface I {
> static java.util.function.Function<String, String> f() { String::trim }
> }
> I.f()
> {code}
> {noformat}
> java.lang.ClassFormatError: Method gstring$String$trim$1 in class I has
> illegal modifiers: 0x101A
> {noformat}
> GROOVY-12536 adds a synthetic adapter method that converts a GString argument
> to String, and creates it {{private static final}}. The JVM rejects
> {{ACC_FINAL}} on an interface method (JVMS 4.6). The other helper methods of
> method references leave out {{ACC_FINAL}} in interfaces since GROOVY-12488.
> No test of GROOVY-12536 had a method reference in an interface;
> {{MethodReferenceTest.testMethodReferencesInStaticAndDefaultMethodsOfInterface}}
> from GROOVY-12488 has, and fails on master since both were merged, on every
> JDK.
> Affects master only (7.0.0-SNAPSHOT); no release has both changes.
> PR: https://github.com/apache/groovy/pull/3116
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)