Skip to content
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 EnumReferenceEqualityLambda Refaster rule #1239

Merged
merged 4 commits into from
Jul 14, 2024

Conversation

mohamedsamehsalah
Copy link
Contributor

@mohamedsamehsalah mohamedsamehsalah commented Jul 8, 2024

Suggested commit message:

Introduce `EnumReferenceEqualityLambda` Refaster rule (#1239)

Copy link

github-actions bot commented Jul 8, 2024

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@mohamedsamehsalah mohamedsamehsalah force-pushed the mohamedsamehsalah/predicate-is-equal-enums branch from 2c79bde to c7c6d3d Compare July 10, 2024 18:54
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@mohamedsamehsalah mohamedsamehsalah force-pushed the mohamedsamehsalah/predicate-is-equal-enums branch 2 times, most recently from 9810772 to dd6235e Compare July 11, 2024 07:09
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202 Stephan202 added this to the 0.17.0 milestone Jul 14, 2024
@Stephan202 Stephan202 changed the title Introduce PredicateIsEqualEnums Introduce EnumReferenceEqualityLambda Refaster rule Jul 14, 2024
@Stephan202 Stephan202 force-pushed the mohamedsamehsalah/predicate-is-equal-enums branch from dd6235e to 3227949 Compare July 14, 2024 08:49
Copy link
Member

@Stephan202 Stephan202 left a 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; also updated the suggested commit message and PR title.

(Not sure the ::equals rewrite is always an improvement. Ideally we benchmark this; should get back to finishing the benchmark framework I started working on 😬.)

@@ -33,6 +34,12 @@ boolean testEqualsPredicate() {
return Stream.of("foo").anyMatch(s -> "bar".equals(s));
}

ImmutableSet<Boolean> testEnumsReferenceEqualityLambda() {
Copy link
Member

Choose a reason for hiding this comment

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

This one should be moved up a bit.

Comment on lines 39 to 40
Stream.of(RoundingMode.UP).anyMatch(isEqual(RoundingMode.DOWN)),
Stream.of(RoundingMode.UP).anyMatch(RoundingMode.DOWN::equals));
Copy link
Member

Choose a reason for hiding this comment

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

We don't need the Stream expressions for this test.

Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link

@rickie rickie merged commit 886e65d into master Jul 14, 2024
15 checks passed
@rickie rickie deleted the mohamedsamehsalah/predicate-is-equal-enums branch July 14, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants