Skip to content

Don't swap if select is a literal in EqualsAvoidsNull#485

Merged
greg-at-moderne merged 1 commit into
mainfrom
greg-EqualsAvoidsNull-literals-go-first
Mar 25, 2025
Merged

Don't swap if select is a literal in EqualsAvoidsNull#485
greg-at-moderne merged 1 commit into
mainfrom
greg-EqualsAvoidsNull-literals-go-first

Conversation

@greg-at-moderne

@greg-at-moderne greg-at-moderne commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

What's changed?

Changing EqualsAvoidsNull so that it prefers the literals to be on the left-hand side of the comparison.

What's your motivation?

@greg-at-moderne greg-at-moderne self-assigned this Mar 25, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Mar 25, 2025

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/test/java/org/openrewrite/staticanalysis/EqualsAvoidsNullTest.java
    • lines 70-70

@greg-at-moderne greg-at-moderne marked this pull request as ready for review March 25, 2025 16:25
@greg-at-moderne greg-at-moderne merged commit 3c29e54 into main Mar 25, 2025
@greg-at-moderne greg-at-moderne deleted the greg-EqualsAvoidsNull-literals-go-first branch March 25, 2025 16:34
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Mar 25, 2025
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.

EqualsAvoidsNull not idempotent

1 participant