Issue #13501: Kill mutation for UnusedLocalVariableCheck 9 #13152
Merged
romani merged 1 commit intocheckstyle:masterfrom Aug 8, 2023
Merged
Issue #13501: Kill mutation for UnusedLocalVariableCheck 9 #13152romani merged 1 commit intocheckstyle:masterfrom
romani merged 1 commit intocheckstyle:masterfrom
Conversation
Contributor
Author
|
Github, generate report |
Contributor
Contributor
Author
|
Github, generate report |
Contributor
12 tasks
Contributor
Author
|
Please ignore pitest it will cover at #13151 |
rdiachenko
approved these changes
Jul 1, 2023
Member
rdiachenko
left a comment
There was a problem hiding this comment.
Restarted circleci, it's green now.
lgtm
Member
|
I restarted pitest failure. |
Contributor
Author
|
This failure is covered #13151 |
Member
|
@Kevin222004 The surviving mutation is different from the one in #13151. |
Contributor
Author
|
#13152 (comment) ohh yes you are right, my misunderstanding I think I have to evaluate whole loop again |
Member
|
@Kevin222004 Please mention if you require any help with this PR. |
This was referenced Aug 2, 2023
Contributor
Author
|
Github, generate report |
Contributor
Contributor
Author
|
Github, generate report |
Member
|
@Vyom-Yadav , please finish review |
Contributor
Vyom-Yadav
reviewed
Aug 8, 2023
Comment on lines
-406
to
-412
| while (currentAst.getType() != TokenTypes.SLIST) { | ||
| if (TokenUtil.isTypeDeclaration(currentAst.getParent().getType())) { | ||
| while (!TokenUtil.isTypeDeclaration(currentAst.getType())) { | ||
| if (currentAst.getType() == TokenTypes.SLIST) { | ||
| result = true; | ||
| break; | ||
| } | ||
| currentAst = currentAst.getParent(); | ||
| } | ||
| result = currentAst.getType() == TokenTypes.SLIST; |
romani
approved these changes
Aug 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #13501: Kill mutation for UnusedLocalVariableCheck 9
Check :-
https://checkstyle.org/checks/coding/unusedlocalvariable.html#UnusedLocalVariable
Mutation
checkstyle/config/pitest-suppressions/pitest-coding-2-suppressions.xml
Lines 66 to 73 in 554a87e
Explaination
TokenUtil.isTypeDeclaration check if the ast is of type
class, enum, record or interface.
know in this all type of the last child is alwyas objBlock token. so the parent of SList never going to be
from isTypeDeclaration so either of checking currentASt Parent if the loops run 1 time more and currentast would be change then ultimately in
result = currentAst.getType() == TokenTypes.SLIST;it will make affect but result will not change.Regression :-
Report-1 ; https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/5346d57_2023074741/reports/diff/index.html
Report-2 : https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/5346d57_2023125641/reports/diff/index.html
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/0dbdfb487f8e9a050ed0e6356f1a35b4/raw/31f7927f400e11e4285e86fd086b373095227848/unusedLocal.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: Regression-Aug-5-2