Skip to content

Commit

Permalink
Issue checkstyle#12280: Resolve Pitest suppression for SingleSpaceSep…
Browse files Browse the repository at this point in the history
…aratorCheck
  • Loading branch information
Kevin222004 committed Oct 9, 2022
1 parent fa68569 commit 4a9de61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
18 changes: 0 additions & 18 deletions .ci/pitest-suppressions/pitest-whitespace-suppressions.xml
Expand Up @@ -116,22 +116,4 @@
<description>replaced call to com/puppycrawl/tools/checkstyle/utils/CodePointUtil::trim with argument</description>
<lineContent>final int[] substringAfterToken = CodePointUtil.trim(</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>SingleSpaceSeparatorCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck</mutatedClass>
<mutatedMethod>visitEachToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getParent</description>
<lineContent>final DetailAST parent = node.getParent();</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>SingleSpaceSeparatorCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck</mutatedClass>
<mutatedMethod>visitEachToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to com/puppycrawl/tools/checkstyle/api/DetailAST::getParent with receiver</description>
<lineContent>final DetailAST parent = node.getParent();</lineContent>
</mutation>
</suppressedMutations>
Expand Up @@ -179,7 +179,6 @@ public void beginTree(DetailAST rootAST) {
*/
private void visitEachToken(DetailAST node) {
DetailAST currentNode = node;
final DetailAST parent = node.getParent();

do {
final int columnNo = currentNode.getColumnNo() - 1;
Expand All @@ -199,7 +198,7 @@ private void visitEachToken(DetailAST node) {
currentNode = currentNode.getFirstChild();
}
else {
while (currentNode.getNextSibling() == null && currentNode.getParent() != parent) {
while (currentNode.getNextSibling() == null && currentNode.getParent() != null) {
currentNode = currentNode.getParent();
}
currentNode = currentNode.getNextSibling();
Expand Down

0 comments on commit 4a9de61

Please sign in to comment.