-
Notifications
You must be signed in to change notification settings - Fork 39
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
Have IdentityConversion
flag com.google.errorprone.matchers.Matchers#{allOf,anyOf}
#420
Conversation
Looks good. No mutations were possible for these changes. |
bac4154
to
ef9d1ba
Compare
Looks good. No mutations were possible for these changes. |
1 similar comment
Looks good. No mutations were possible for these changes. |
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.
Added a commit.
Alternative suggested commit message:
Have `IdentityConversion` flag `com.google.errorprone.matchers.Matchers#{allOf,anyOf}` (#420)
Thanks for opening a PR @EvgheniiShipilov , it looks good 🚀!
error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java
Outdated
Show resolved
Hide resolved
...r-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/IdentityConversionTest.java
Outdated
Show resolved
Hide resolved
Looks good. No mutations were possible for these changes. |
59212f0
to
9a2dc67
Compare
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.
Rebased and added a commit. Expanding on @rickie's suggested commit message:
Have `IdentityConversion` flag `com.google.errorprone.matchers.Matchers#{allOf,anyOf}` (#420)
While there, sort and rename some (test) code.
Fixes #340.
"", | ||
" // BUG: Diagnostic contains:", | ||
" Matcher matcher1 = Matchers.allOf(annotations(AT_LEAST_ONE, isType(\"foo\")));", | ||
" // BUG: Diagnostic contains:", | ||
" Matcher matcher2 = Matchers.anyOf(annotations(AT_LEAST_ONE, isType(\"bar\")));", |
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.
We can also move these up a bit, in line with the main code order. (Edit: seems there are other inconsistencies. Will move some stuff around.)
Next to that:
- We can use simpler expressions for this test.
- We should do this more generally, but since it's cheap for this case: let's also add some non-matching cases.
Looks good. No mutations were possible for these changes. |
Changes LGTM @Stephan202! |
allOf
, anyOf
error-prone matchersIdentityConversion
flag com.google.errorprone.matchers.Matchers#{allOf,anyOf}
Check for cases when
allOf
andanyOf
Matchers have a single parameter. Such cases can be rewritten by simply omitting the respective method.Matchers.{allOf,anyOf}
containing a singleMatcher
#340Suggested commit message: