Skip to content

Fix RemoveInstanceOfPatternMatch crash on Groovy files#828

Merged
timtebeek merged 1 commit intomainfrom
tim/fix-issue-2
Mar 13, 2026
Merged

Fix RemoveInstanceOfPatternMatch crash on Groovy files#828
timtebeek merged 1 commit intomainfrom
tim/fix-issue-2

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Mar 13, 2026

Exclude Groovy files from RemoveInstanceOfPatternMatch recipe using GroovyFileChecker precondition. The recipe relies on visitCompilationUnit(J.CompilationUnit) to initialize variableUsage, which is never called for Groovy's G.CompilationUnit, causing a NullPointerException when processing Groovy files like build.gradle.

Exclude Groovy files from RemoveInstanceOfPatternMatch recipe using GroovyFileChecker precondition. The recipe relies on visitCompilationUnit(J.CompilationUnit) to initialize variableUsage, which is never called for Groovy's G.CompilationUnit, causing a NullPointerException when processing Groovy files like build.gradle.

Fixes #2
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Mar 13, 2026
@timtebeek timtebeek merged commit 3b3224b into main Mar 13, 2026
1 check passed
@timtebeek timtebeek deleted the tim/fix-issue-2 branch March 13, 2026 10:00
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

RemoveInstanceOfPatternMatch crashes at groovy

1 participant