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 getFirstNodeInsideForWhileDoWhileBlocks
  • Loading branch information
Vyom-Yadav authored and baratali committed Jul 27, 2022
1 parent 41a0668 commit 5e61fbb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-coding-1-suppressions.xml
Expand Up @@ -9,15 +9,6 @@
<lineContent>if (!firstUsageFound) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>VariableDeclarationUsageDistanceCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck</mutatedClass>
<mutatedMethod>getFirstNodeInsideForWhileDoWhileBlocks</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE</mutator>
<description>removed conditional - replaced equality check with false</description>
<lineContent>if (currentNodeType == TokenTypes.SLIST) {</lineContent>
</mutation>

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

final int currentNodeType = currentNode.getType();

if (currentNodeType == TokenTypes.SLIST) {
firstNodeInsideBlock = currentNode.getFirstChild();
}
else if (currentNodeType != TokenTypes.EXPR) {
if (currentNodeType != TokenTypes.EXPR) {
firstNodeInsideBlock = currentNode;
}
}
Expand Down

0 comments on commit 5e61fbb

Please sign in to comment.