Skip to content

Fix parsing of parameterized types in method arguments in Groovy #5759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

e5LA
Copy link
Contributor

@e5LA e5LA commented Jul 15, 2025

What's changed?

Updated visitClassExpression to support parsing parameterized (generic) types.

What's your motivation?

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@e5LA e5LA force-pushed the groovy-fix-parametrized-type branch from e52afbc to d113725 Compare July 15, 2025 19:21
@e5LA
Copy link
Contributor Author

e5LA commented Jul 15, 2025

Hmm, looks like the build has failed with:

    java.lang.RuntimeException: org.gradle.tooling.BuildException: Could not fetch model of type 'OpenRewriteModel' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.12-bin.zip'.
        at org.openrewrite.test.UncheckedConsumer.accept(UncheckedConsumer.java:29)
        at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:342)
        at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:130)
        at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:125)
        at org.openrewrite.gradle.trait.JvmTestSuiteTest$GroovyDsl.all(JvmTestSuiteTest.java:43)

        Caused by:
        org.gradle.tooling.BuildException: Could not fetch model of type 'OpenRewriteModel' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.12-bin.zip'.
            at app//org.gradle.tooling.internal.consumer.ConnectionExceptionTransformer.transform(ConnectionExceptionTransformer.java:69)
            at app//org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:42)
            at app//org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncCons

I saw other builds failing the same way. Is this known 'flacky test'?
Shall tests depend on external resources?

@e5LA e5LA marked this pull request as ready for review July 15, 2025 20:01
@e5LA e5LA force-pushed the groovy-fix-parametrized-type branch from 9aedd33 to d17b56d Compare July 15, 2025 20:02
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Jul 16, 2025
@timtebeek timtebeek added bug Something isn't working groovy parser labels Jul 16, 2025
Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for yet another perfect parser fix @e5LA ! 🙌🏻

@timtebeek timtebeek merged commit 3f2ccad into openrewrite:main Jul 16, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working groovy parser
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Groovy parsing of script fails with org.openrewrite.groovy.GroovyParsingException
2 participants