-
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
Introduce IsIdentityOperation
matcher for use by Refaster templates
#749
Conversation
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
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.
Some context.
@@ -31,6 +31,7 @@ ImmutableSet<Comparator<String>> testNaturalOrder() { | |||
String::compareTo, | |||
Comparator.comparing(identity()), | |||
Comparator.comparing(s -> s), | |||
Comparator.comparing(s -> 0), |
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.
For each rule, added a non-identity transformation test case, to validate that the @Matcher
annotation is present.
" DoubleUnaryOperator positive1() {", | ||
" // BUG: Diagnostic contains:", | ||
" return DoubleUnaryOperator.identity();", | ||
" }", | ||
"", | ||
" Function<Integer, Integer> positive2() {", | ||
" // BUG: Diagnostic contains:", | ||
" return Function.identity();", | ||
" }", | ||
"", | ||
" UnaryOperator<String> positive3() {", | ||
" // BUG: Diagnostic contains:", | ||
" return UnaryOperator.identity();", | ||
" }", | ||
"", | ||
" IntUnaryOperator positive4() {", | ||
" // BUG: Diagnostic contains:", | ||
" return IntUnaryOperator.identity();", | ||
" }", | ||
"", | ||
" LongUnaryOperator positive5() {", | ||
" // BUG: Diagnostic contains:", | ||
" return LongUnaryOperator.identity();", | ||
" }", |
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.
Previously we would only match Function.identity()
. Our internal code base contains a number of UnaryOperator.identity()
usages that were thus not matched by the Refaster rules.
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
7397826
to
4fb3656
Compare
Rebased and resolved conflicts. |
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
4fb3656
to
3a3a6c5
Compare
Kudos, SonarCloud Quality Gate passed! |
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
3a3a6c5
to
f65c02b
Compare
Rebased and resolved conflicts. |
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
Generalized a few more Refaster rules this way. |
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
1 similar comment
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
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.
LGTM 🚀
92689b9
to
92e98fe
Compare
Rebased and resolved conflicts. |
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
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.
Nice one ✨ ! Love the improvements in the rule collections 😄 !
92e98fe
to
b682638
Compare
Want to add something to the commit message? Something like |
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
Good point @rickie. How about (slightly tweaked):
|
I'll have a look at the conflict. |
Conflict was trivial. Rebased. |
b682638
to
209970e
Compare
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
209970e
to
7880617
Compare
Looks good. All 8 mutations in this change were killed.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
Kudos, SonarCloud Quality Gate passed! |
Suggested commit message: