Skip to content

Issue #13109: Kill mutation for UnnecessaryParenthesesCheck#13136

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:u1
Jun 13, 2023
Merged

Issue #13109: Kill mutation for UnnecessaryParenthesesCheck#13136
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:u1

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 2, 2023

Issue #13109: Kill mutation for UnnecessaryParenthesesCheck


Check :-

https://checkstyle.org/config_coding.html#UnnecessaryParentheses


mutation

<mutation unstable="false">
<sourceFile>UnnecessaryParenthesesCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck</mutatedClass>
<mutatedMethod>checkExpression</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable parentToSkip</description>
<lineContent>parentToSkip = null;</lineContent>
</mutation>


Explaination

The only reason i can see to removal of this will not make issue is the checkExpression method is used only in leaveToken

            if (type == TokenTypes.EXPR) {
                checkExpression(ast);
            }

so the changes of ParentToSkip will not really make any effect in code because token will be leaved if the is statment is been executed, it will never be used after it.


Regression :-
https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/13cdd33_2023060542/reports/diff/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/13cdd33_2023085740/reports/diff/index.html

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2023

@Kevin222004 Kevin222004 force-pushed the u1 branch 2 times, most recently from 1249c62 to 94b6da1 Compare June 10, 2023 11:30
@Kevin222004 Kevin222004 marked this pull request as ready for review June 10, 2023 11:37
Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Ok to merge.

We do not use null state of this field.

Copy link
Copy Markdown
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

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

lgtm

@Vyom-Yadav
Copy link
Copy Markdown
Member

@Kevin222004 Please resolve the conflicts.

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@Vyom-Yadav done

Copy link
Copy Markdown
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green.

@Vyom-Yadav Vyom-Yadav assigned romani and unassigned Vyom-Yadav Jun 13, 2023
@romani romani merged commit 24a4b06 into checkstyle:master Jun 13, 2023
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.

4 participants