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 calculateDistanceInSingleScope
  • Loading branch information
Vyom-Yadav authored and baratali committed Jul 27, 2022
1 parent f9a7aee commit e635897
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-coding-1-suppressions.xml
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>
<mutation unstable="false">
<sourceFile>VariableDeclarationUsageDistanceCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck</mutatedClass>
<mutatedMethod>calculateDistanceInSingleScope</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>&amp;&amp; currentAst.getType() != TokenTypes.RCURLY) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>VariableDeclarationUsageDistanceCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck</mutatedClass>
Expand Down
Expand Up @@ -530,8 +530,7 @@ private static Entry<DetailAST, Integer> calculateDistanceInSingleScope(
DetailAST currentAst = semicolonAst;
DetailAST variableUsageAst = null;

while (!firstUsageFound && currentAst != null
&& currentAst.getType() != TokenTypes.RCURLY) {
while (!firstUsageFound && currentAst != null) {
if (currentAst.getFirstChild() != null) {
if (isChild(currentAst, variableIdentAst)) {
dist = getDistToVariableUsageInChildNode(currentAst, variableIdentAst, dist);
Expand Down

0 comments on commit e635897

Please sign in to comment.