Skip to content

Groovy: Fix NPE with generics of an unknown class#7488

Merged
greg-at-moderne merged 1 commit intomainfrom
greg-groovy-diamond-import-npe
Apr 28, 2026
Merged

Groovy: Fix NPE with generics of an unknown class#7488
greg-at-moderne merged 1 commit intomainfrom
greg-groovy-diamond-import-npe

Conversation

@greg-at-moderne
Copy link
Copy Markdown
Contributor

@greg-at-moderne greg-at-moderne commented Apr 28, 2026

What's changed?

Fix Groovy parser in one corner case. When a class is not known (lacking from classpath) and there's generics expression with it, e.g.

              import a.b.Foo
              def x = new Foo<>()

What's your motivation?

It currently fails with NullPointerException.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Apr 28, 2026
@greg-at-moderne greg-at-moderne marked this pull request as ready for review April 28, 2026 10:50
@greg-at-moderne greg-at-moderne merged commit 2d4a5a0 into main Apr 28, 2026
1 check passed
@greg-at-moderne greg-at-moderne deleted the greg-groovy-diamond-import-npe branch April 28, 2026 10:51
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant