Skip to content

Commit

Permalink
Issue #11720: Kill surviving mutation in VariableDeclarationUsageDist…
Browse files Browse the repository at this point in the history
…anceCheck in isVariableInOperatorExpr
  • Loading branch information
Vyom-Yadav authored and baratali committed Jul 27, 2022
1 parent e635897 commit 41a0668
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-coding-1-suppressions.xml
Expand Up @@ -45,15 +45,6 @@
<lineContent>while (result</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>VariableDeclarationUsageDistanceCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck</mutatedClass>
<mutatedMethod>isVariableInOperatorExpr</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>if (!isVarInOperatorDeclaration &amp;&amp; operator.getType() == TokenTypes.LITERAL_IF) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>VariableDeclarationUsageDistanceCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck</mutatedClass>
Expand Down
Expand Up @@ -958,7 +958,7 @@ private static boolean isVariableInOperatorExpr(

// Variable may be met in ELSE declaration
// So, check variable usage in these declarations.
if (!isVarInOperatorDeclaration && operator.getType() == TokenTypes.LITERAL_IF) {
if (!isVarInOperatorDeclaration) {
final DetailAST elseBlock = operator.getLastChild();

if (elseBlock.getType() == TokenTypes.LITERAL_ELSE) {
Expand Down

0 comments on commit 41a0668

Please sign in to comment.