Skip to content

Conversation

@timtebeek
Copy link
Member

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Sep 21, 2025
@timtebeek timtebeek self-assigned this Sep 21, 2025
@timtebeek timtebeek added the bug Something isn't working label Sep 21, 2025
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Sep 23, 2025
@timtebeek timtebeek marked this pull request as ready for review September 23, 2025 21:28
timtebeek and others added 3 commits September 23, 2025 23:29
Reorder recipe examples and update parameters based on automated refactoring

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add example to examples.yml demonstrating pattern variable naming conflict scenario
- Add @DocumentExample annotation to the primary test case

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@timtebeek timtebeek merged commit 752d998 into main Sep 23, 2025
2 checks passed
@timtebeek timtebeek deleted the naming-conflict branch September 23, 2025 21:50
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Sep 23, 2025
class Foo {
void bar(Object o1, Object o2) {
if (o1 instanceof LeftNode node2 && o2 instanceof RightNode node3) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Surprising to see node2 and node3 before node and node1.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that slightly annoyed me as well, but figured since we're already a few levels deep into edge cases (classes with the same suffix, used in binaries, with an else of overlapping instanceof expressions) I didn't want to explore how to switch those around and risk potentially breaking other logic that had assumed a particular processing order. From a brief look into it it's not as easy as moving down a super.visit call unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Name clash after running InstanceOfPatternMatch

3 participants