Skip to content

Commit

Permalink
Issue checkstyle#12275: Resolve Pitest suppression for EmptyForInitia…
Browse files Browse the repository at this point in the history
…lizerPad-2
  • Loading branch information
Kevin222004 committed Oct 9, 2022
1 parent fa68569 commit 1359fe3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-whitespace-suppressions.xml
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>
<mutation unstable="false">
<sourceFile>EmptyForInitializerPadCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck</mutatedClass>
<mutatedMethod>visitToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to com/puppycrawl/tools/checkstyle/api/DetailAST::getNextSibling with receiver</description>
<lineContent>final DetailAST semi = ast.getNextSibling();</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>EmptyLineSeparatorCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck</mutatedClass>
Expand Down
Expand Up @@ -149,10 +149,9 @@ public int[] getRequiredTokens() {
public void visitToken(DetailAST ast) {
if (!ast.hasChildren()) {
// empty for initializer. test pad before semi.
final DetailAST semi = ast.getNextSibling();
final int semiLineIdx = semi.getLineNo() - 1;
final int semiLineIdx = ast.getLineNo() - 1;
final int[] line = getLineCodePoints(semiLineIdx);
final int before = semi.getColumnNo() - 1;
final int before = ast.getColumnNo() - 1;
// don't check if semi at beginning of line
if (!CodePointUtil.hasWhitespaceBefore(before, line)) {
if (option == PadOption.NOSPACE
Expand Down

0 comments on commit 1359fe3

Please sign in to comment.