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
Issue #11720: Kill surviving mutation in RequireThisCheck related to checking static context #11797
Issue #11720: Kill surviving mutation in RequireThisCheck related to checking static context #11797
Conversation
f3b905d
to
84e8d44
Compare
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheck.java
Outdated
Show resolved
Hide resolved
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.
Blocked until #11792
64965bf
to
f1469d6
Compare
Github, generate report |
DefaultConfig: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/f1469d6_2022195342/reports/diff/index.html Only diff is change in line in exception message, issue is opened at #11807 |
Github, generate report |
validateOnlyOverlappingFalse: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/f1469d6_2022215143/reports/diff/index.html Only diff is change in line in exception message, issue is opened at #11807 |
f1469d6
to
dfdcc07
Compare
6f2bf8d
to
6fa2832
Compare
…elated to checking static context
6fa2832
to
361247d
Compare
This condition will be useful when fixing bugs related to this in the future, so better to leave this mutation on the survival list. It will help deal with static blocks and instance blocks separately from ctors and method_def, I made a few changes when I was fixing the check, this commit uses this condition Vyom-Yadav@4bcd687 |
#11720
Hardcoded mutation tested at #11777
Reports with hardcoded mutation (clean): Modification will be more than just hardcoding mutation, reports will be generated again.
validateOnlyOverlapping = false
report was not generated with OpenJDK (Out of memory in GitHub actions), though it is very unlikely that it will show any difference, still, if it is required, ping me, and I will generate it locally.This mutation falls in the category:
Rationale:
If
staticContext
is going to betrue
, thencodeBlockDefinition
is not going to be null, so the condition will be sufficient. It is not going to be null as we can have either a static method or a static block.Generating reports again:
Diff Regression config: https://gist.githubusercontent.com/Vyom-Yadav/98dceb63a79f4833e85fff9b2e1464a6/raw/5dc88b466a50335d5759f60c1d041a239f11a5a1/my_checks.xml
Diff Regression projects: https://raw.githubusercontent.com/checkstyle/contribution/4d44ec5e49358d8a0ddbf1925dbc677ab26a69b2/checkstyle-tester/latest-projects-to-test-on.properties
Report label: validateOnlyOverlappingFalse