Skip to content

Issue #12671: Kill mutation for finalLocalVariable-2#13185

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

Issue #12671: Kill mutation for finalLocalVariable-2#13185
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:FLC2

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 8, 2023

Issue #12671: Kill mutation for finalLocalVariable-2


Check

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


mutation covered

<mutation unstable="false">
<sourceFile>FinalLocalVariableCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck</mutatedClass>
<mutatedMethod>updateUninitializedVariables</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>&amp;&amp; isSameVariables(storedVariable, variable)</lineContent>
</mutation>


Explanination

ok so the && isSameVariables(storedVariable, variable) condition in if will check wether the StoredVariable and variable is same or not.

Know if Storedvariable is null then the condition will not execute and if it is not then storedVariable = candidate.variableIdent; and final FinalVariableCandidate candidate = scopeData.scope.get(variable.getText());
know as per the initalization of candidate it will always get data scope which is variable

and stored variable is also assigned as storedVariable = candidate.variableIdent; hence to compare storedVariable, variable will always become ture.


Regreesion

  1. https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/767ef0a_2023201302/reports/diff/index.html
  2. https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/767ef0a_2023162013/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 8, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 9, 2023

@Kevin222004 Kevin222004 marked this pull request as ready for review June 10, 2023 05:16
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.

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!

@Vyom-Yadav Vyom-Yadav assigned rdiachenko and unassigned Vyom-Yadav Jun 13, 2023
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

@rdiachenko rdiachenko assigned romani and unassigned rdiachenko Jun 13, 2023
@romani romani merged commit fec2aa8 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