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

Issue #11720: Kill surviving mutation in RequireThisCheck related to checking static context #11797

Conversation

Vyom-Yadav
Copy link
Member

@Vyom-Yadav Vyom-Yadav commented Jun 30, 2022

#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:

  • Safely (no regressions) remove code to be covered

Rationale:

If staticContext is going to be true, then codeBlockDefinition 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

@Vyom-Yadav Vyom-Yadav force-pushed the killSurvivingMutationInRequireThisCheck-4 branch from f3b905d to 84e8d44 Compare June 30, 2022 02:04
@nrmancuso nrmancuso self-requested a review June 30, 2022 12:37
@nrmancuso nrmancuso self-assigned this Jun 30, 2022
Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

Blocked until #11792

@nrmancuso nrmancuso removed the blocked label Jul 1, 2022
@Vyom-Yadav Vyom-Yadav force-pushed the killSurvivingMutationInRequireThisCheck-4 branch 2 times, most recently from 64965bf to f1469d6 Compare July 1, 2022 18:43
@Vyom-Yadav
Copy link
Member Author

Github, generate report

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

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

@Vyom-Yadav
Copy link
Member Author

Github, generate report

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

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

@Vyom-Yadav Vyom-Yadav force-pushed the killSurvivingMutationInRequireThisCheck-4 branch from f1469d6 to dfdcc07 Compare July 2, 2022 06:46
@nrmancuso nrmancuso self-requested a review July 2, 2022 14:50
@nrmancuso nrmancuso removed their assignment Jul 2, 2022
@Vyom-Yadav Vyom-Yadav force-pushed the killSurvivingMutationInRequireThisCheck-4 branch 3 times, most recently from 6f2bf8d to 6fa2832 Compare July 3, 2022 05:13
@Vyom-Yadav Vyom-Yadav force-pushed the killSurvivingMutationInRequireThisCheck-4 branch from 6fa2832 to 361247d Compare July 3, 2022 05:17
@Vyom-Yadav
Copy link
Member Author

Vyom-Yadav commented Jul 3, 2022

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

@Vyom-Yadav Vyom-Yadav closed this Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants