You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/15 13:14:00 UTC
[jira] [Commented] (GROOVY-10290) Dynamic Groovy code in Gradle doesn't compile because of $getLookup() method is not static
[ https://issues.apache.org/jira/browse/GROOVY-10290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17492606#comment-17492606 ]
Paul King commented on GROOVY-10290:
------------------------------------
Proposed PR:
https://github.com/apache/groovy/pull/1685
We actually write an instance method for non-static inner classes due to JVM limitations for pre-16 JDKs:
https://github.com/apache/groovy/blob/master/src/main/java/org/codehaus/groovy/classgen/Verifier.java#L448-L451
But there is no need for that synthetic method to appear in the stubs.
> Dynamic Groovy code in Gradle doesn't compile because of $getLookup() method is not static
> ------------------------------------------------------------------------------------------
>
> Key: GROOVY-10290
> URL: https://issues.apache.org/jira/browse/GROOVY-10290
> Project: Groovy
> Issue Type: Bug
> Components: Stub generator / Joint compiler
> Affects Versions: 4.0.0-beta-1
> Reporter: Lóránt Pintér
> Priority: Major
> Attachments: SFTPServer.java
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Steps to reproduce:
> * check out [https://github.com/gradle/gradle/releases/tag/groovy-4-compile-problem]
> * run {{./gradlew :internal-integ-test:compileGroovy --no-configuration-cache}}
> Output:
> {code}
> /Users/lptr/Workspace/gradle/gradle/subprojects/internal-integ-testing/build/tmp/compileGroovy/groovy-java-stubs/org/gradle/test/fixtures/server/sftp/SFTPServer.java:164: error: $getLookup() in SFTPServer.SftpExpectOneOpen cannot override $getLookup() in SftpExpectOnePath
> public java.lang.invoke.MethodHandles.Lookup $getLookup() { return (java.lang.invoke.MethodHandles.Lookup)null;}
> ^
> overridden method is static
> /Users/lptr/Workspace/gradle/gradle/subprojects/internal-integ-testing/build/tmp/compileGroovy/groovy-java-stubs/org/gradle/test/fixtures/server/sftp/SFTPServer.java:178: error: $getLookup() in SFTPServer.SftpExpectOneHandle cannot override $getLookup() in SftpExpectOnePath
> public java.lang.invoke.MethodHandles.Lookup $getLookup() { return (java.lang.invoke.MethodHandles.Lookup)null;}
> ^
> overridden method is static
> {code}
> See the attached {{SFTPServer.java}} for the generated stubs.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)