-
Notifications
You must be signed in to change notification settings - Fork 93
address: LiteralsFirstInComparisons PMD rule #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
timtebeek
merged 64 commits into
openrewrite:main
from
Pankraz76:EqualsAvoidsNullVisitor-extend-literalsfirstincomparisons_extend
Oct 22, 2024
Merged
Changes from 58 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
78eb2e7
wip
pinguin3245678 db907e9
wip
pinguin3245678 44432a0
wip BAR_CONTENT_EQUALS
pinguin3245678 6bbb603
add compareToIgnoreCase
pinguin3245678 3b95e60
wip
pinguin3245678 b6f48c8
undo
pinguin3245678 b187593
fix name for direct matching
pinguin3245678 735ca39
EQUALS_IGNORE_CASE
pinguin3245678 111baaa
add CONTENT_EQUALS
pinguin3245678 709a488
add compareToInverted
pinguin3245678 983b7f5
tmp fix
pinguin3245678 d9f83f6
wip
pinguin3245678 5b30904
fix working
pinguin3245678 13d7057
wiß
pinguin3245678 cc2c022
wip
pinguin3245678 e94ff44
wip
pinguin3245678 8addad3
wip
pinguin3245678 21f37a4
wip
pinguin3245678 e424b6f
finalize
pinguin3245678 9470cd4
sort
pinguin3245678 35ed8cf
add doc
pinguin3245678 a519472
undo
pinguin3245678 2f0e9b8
Update src/test/java/org/openrewrite/staticanalysis/EqualsAvoidsNullV…
931755a
Merge branch 'main' into EqualsAvoidsNullVisitor-extend-literalsfirst…
2c2b33a
fix Cast after
pinguin3245678 7e813dc
Merge remote-tracking branch 'origin/EqualsAvoidsNullVisitor-extend-l…
pinguin3245678 241262f
Update src/test/java/org/openrewrite/staticanalysis/EqualsAvoidsNullV…
4d78d78
Revert "fix Cast after"
pinguin3245678 ca9d3d7
wip: error: pattern matching in instanceof is not supported in -source 8
pinguin3245678 55b8299
cast
pinguin3245678 bec2a8e
Revert build.gradle changes; rewrite-bom manages rewrite-java
timtebeek 477820a
Merge remote-tracking branch 'origin/EqualsAvoidsNullVisitor-extend-l…
pinguin3245678 e1cdc55
format
pinguin3245678 0f85697
condense
pinguin3245678 f2b94d4
condense
pinguin3245678 396d43b
apply style
pinguin3245678 6c205af
wip
pinguin3245678 586d85e
format fin
pinguin3245678 d1b6c1d
fix
pinguin3245678 0715f12
isStringComparisonMethod
pinguin3245678 28f0313
remove null
pinguin3245678 65a46a6
undo
pinguin3245678 0948c77
Update src/main/java/org/openrewrite/staticanalysis/EqualsAvoidsNullV…
32e089e
add doc
pinguin3245678 29ad521
Merge remote-tracking branch 'origin/EqualsAvoidsNullVisitor-extend-l…
pinguin3245678 4cc0405
fix getSuperIfSelectNull
pinguin3245678 5c54ac0
paranthese
pinguin3245678 b70d866
fix dry
pinguin3245678 0ee53b4
fix if
pinguin3245678 cae686e
fix if
pinguin3245678 cbe6400
fix literalsFirstInComparisons
pinguin3245678 f4e2a59
order
pinguin3245678 82ba719
dry firstArgument
pinguin3245678 34ced7e
naming
pinguin3245678 7767c42
Merge branch 'main' into EqualsAvoidsNullVisitor-extend-literalsfirst…
4ec7e3b
Update src/main/java/org/openrewrite/staticanalysis/EqualsAvoidsNullV…
d279932
Fix earlier incorrect bot suggestion
timtebeek 3e715de
Place binary operators on same line; remove nested ternaries
timtebeek a2c3c1f
Restore more deliberate naming of `potentialNullCheck`
timtebeek dd458ab
Collapse imports as per what's common elsewhere
timtebeek 9fed309
Make the method matchers static final again
timtebeek 2a582a1
add leftover
pinguin3245678 dadb102
Merge remote-tracking branch 'origin/EqualsAvoidsNullVisitor-extend-l…
pinguin3245678 726c5b0
Use JSpecify nullable annotations
timtebeek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps LiteralsFirstInComparisonsVisitor would be a better fit to align with the corresponding PMD rule name already in place, as it's no longer just about equality; both equality and comparison are now merely implementation details.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd perhaps hold off on renaming this just yet. While the visitor only appears to be used in this module, the recipe name is well established as part of our Common static analysis issues recipe, which folks have created custom copies off that might break if we similarly rename the recipe. I'll think this over as I go through the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thanks. Its just an idea and of course would be a new PR topic.