Skip to content

fix: use box for primitives when rewriting instanceof (#528)#530

Merged
timtebeek merged 4 commits into
openrewrite:mainfrom
cortlepp:fix/instanceof-rewrite-primitives
Apr 27, 2025
Merged

fix: use box for primitives when rewriting instanceof (#528)#530
timtebeek merged 4 commits into
openrewrite:mainfrom
cortlepp:fix/instanceof-rewrite-primitives

Conversation

@cortlepp

@cortlepp cortlepp commented Apr 27, 2025

Copy link
Copy Markdown
Contributor

What's changed?

We now only use the boxed variants of primitives when rewriting instanceof.

What's your motivation?

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

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

- if the cast is a primitive, always use the box from the `instanceof` type
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Apr 27, 2025
@greg-at-moderne greg-at-moderne self-requested a review April 27, 2025 10:00
@timtebeek timtebeek assigned timtebeek and cortlepp and unassigned timtebeek Apr 27, 2025

@timtebeek timtebeek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the immediate fix @cortlepp !

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Apr 27, 2025
@timtebeek timtebeek added bug Something isn't working recipe labels Apr 27, 2025
@timtebeek timtebeek merged commit 67810ab into openrewrite:main Apr 27, 2025
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Apr 27, 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 recipe

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

InstanceOfPatternMatch recipe replaces wrapper types with primitives in instanceof

2 participants