Skip to content

Inline nested visitor classes into getVisitor() - #1026

Merged
timtebeek merged 1 commit into
mainfrom
tim/inline-nested-visitor-class
Aug 25, 2026
Merged

Inline nested visitor classes into getVisitor()#1026
timtebeek merged 1 commit into
mainfrom
tim/inline-nested-visitor-class

Conversation

@timtebeek

@timtebeek timtebeek commented Aug 25, 2026

Copy link
Copy Markdown
Member
  • Result of running the new InlineNestedVisitorClass recipe, which replaces a getVisitor() that returns a named private static nested visitor with that visitor declared anonymously in place.

Touches NeedBraces, ExplicitLambdaArgumentTypes and RemoveToStringCallsFromArrayInstances; beyond the class declaration itself the diff is a pure re-indent, and ./gradlew build passes.

Three other recipes here match the same shape but are intentionally left alone, since their nested visitors declare private static final matchers that an anonymous class cannot hold on our Java 8 baseline.

Applied `org.openrewrite.java.recipes.InlineNestedVisitorClass`.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Aug 25, 2026
@timtebeek
timtebeek merged commit 3b1755a into main Aug 25, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/inline-nested-visitor-class branch August 25, 2026 14:56
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 25, 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.

1 participant