Skip to content

Conversation

Jenson3210
Copy link
Contributor

What's changed?

Added a recipe for pattern matching in Instace of if-checks.

I am creating as draft due to the JavaTemplate usage here.

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

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jun 17, 2025
@timtebeek timtebeek changed the title Initial version Pattern matching for instanceof Jun 17, 2025
@timtebeek timtebeek added recipe Recipe requested java 21+ labels Jun 17, 2025
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
return Objects.requireNonNullElse(obj, "default");
}
}
language: java
Copy link
Member

Choose a reason for hiding this comment

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

Quick FYI: local recipe runs and platform recipe runs disagree about the order, but are each internally consistent. No idea why, but best to limit your changes to new additions if you're kind enough to run these locally. (No need to update, just FYI)

@knutwannheden
Copy link
Contributor

knutwannheden commented Jun 18, 2025

@Jenson3210
Copy link
Contributor Author

Closing in favour of the one brought by @knutwannheden.

@Jenson3210 Jenson3210 closed this Jun 19, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Jun 19, 2025
@Jenson3210 Jenson3210 deleted the issue-763 branch June 19, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java 21+ recipe Recipe requested

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Pattern Matching for instanceof / JEP 394

3 participants