[
https://issues.apache.org/jira/browse/GROOVY-12591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135547#comment-18135547
]
ASF GitHub Bot commented on GROOVY-12591:
-----------------------------------------
codeconsole commented on PR #3116:
URL: https://github.com/apache/groovy/pull/3116#issuecomment-6539062663
Closing: @paulk-asert made the same change on master in b76142b871
(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.
> 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)