Issue #13109: Kill mutation for FullIdent.java#13178
Merged
romani merged 1 commit intocheckstyle:masterfrom Jun 12, 2023
Merged
Issue #13109: Kill mutation for FullIdent.java#13178romani merged 1 commit intocheckstyle:masterfrom
romani merged 1 commit intocheckstyle:masterfrom
Conversation
Member
|
@Kevin222004 please generate a report |
Contributor
Author
|
@rdiachenko How can i generate report for this change |
Member
Take few checks which use that class and generate report for them. |
Member
|
Not a class, but affected method. This class is unfortunate API, so by API rules we do not know it can be used, it just should work in all cases. |
romani
approved these changes
Jun 8, 2023
Member
romani
left a comment
There was a problem hiding this comment.
Ok to merge as some extra testing is provided
Contributor
Author
|
Github, generate report |
Contributor
Contributor
Author
|
Github, generate report |
Contributor
Vyom-Yadav
approved these changes
Jun 12, 2023
Member
Vyom-Yadav
left a comment
There was a problem hiding this comment.
These lines cover the prior conditions of the ast passed to the method to be non null and not of type EXPR (as if ast is of type EXPR a case exists where if EXPR is passed, it will also break from the loop).
LGTM!
40 tasks
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 #13109: Kill mutation for FullIdent.java
Mutation Covered
checkstyle/config/pitest-suppressions/pitest-api-suppressions.xml
Lines 57 to 73 in b8753a7
Explaination
So we have code :-
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java
Lines 119 to 128 in b8753a7
in which
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java
Line 120 in b8753a7
is mutated as
DetailAST expression = arrayDeclaratorHere expression is assigned as
arrayDeclarator.getFirstChildwhen the loop is going to start it will check whether the expression is null or not know if we remove
.getFirstChildthenexpression=arrayDeclaratorknow arrayDeclarator is never going to be null so the loop will always execute, in the loop we have if a condition likeexpression.getType() == TokenTypes.EXPRwhich always becomes false because ast is an arrayDeclarator token.and then at last
expression = expression.getFirstChild()hence here is the case why the removal will not affect.the expression here is again assigned as
expression.getFirstChild. so it is not possible a test case in which we can create a test where.getFirstChild()will fail if we assigned it or not it will always execute.by removal of this effect would the loop run one time more than it was running before.
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/1f89420b96e95d45a945d0f8846d0d0f/raw/ed5ab114bdbdd1359c85db6edf11c4126a0e5965/fullident.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: Regression-2