Detected at https://github.com/checkstyle/checkstyle/pull/11437/files
All filters should migrate to use config inlined in Input files.
Suppression that was left in that commit should be removed.
we should not have not real tests, we should cover all functionalilty by full functional tests, to make sure xpath works to match real nodes.
all tests from XpathFilterElementTest should be converted to tests in SuppressionXpathSingleFilterTest where we load whole Input file with Check and Filter in header of file and confirm that violation is suppressed on required node.
Analysis from @Carbon14-48
testNonMatchingTokenType :
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "isXpathQueryMatching"
Line Contents: "isMatching = abstractNode.getTokenType() == event.getTokenType()"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF"
Description: "removed conditional - replaced equality check with true"
Line Number: 173
testNonMatchingColumnNumber:
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "isXpathQueryMatching"
Line Contents: "&& abstractNode.getColumnNumber() == event.getColumnCharIndex();"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF"
Description: "removed conditional - replaced equality check with true"
Line Number: 175
testNullFileName:
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "isFileNameAndModuleAndModuleNameMatching"
Line Contents: "return event.fileName() != null"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF"
Description: "removed conditional - replaced equality check with true"
Line Number: 138
testNonMatchingFileRegexp:
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "<init>"
Line Contents: "this(Optional.ofNullable(files).map(Pattern::compile).orElse(null),"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator"
Description: "removed call to java/util/Optional::orElse"
Line Number: 79
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "<init>"
Line Contents: "this(Optional.ofNullable(files).map(Pattern::compile).orElse(null),"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.experimental.ArgumentPropagationMutator"
Description: "replaced call to java/util/Optional::orElse with argument"
Line Number: 79
testNullViolation:
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "isFileNameAndModuleAndModuleNameMatching"
Line Contents: "&& event.violation() != null"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF"
Description: "removed conditional - replaced equality check with true"
Line Number: 140
testDecideByMessage:
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "<init>"
Line Contents: "Optional.ofNullable(message).map(Pattern::compile).orElse(null),"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator"
Description: "removed call to java/util/Optional::orElse"
Line Number: 81
Source File: "XpathFilterElement.java"
Class: "com.puppycrawl.tools.checkstyle.filters.XpathFilterElement"
Method: "<init>"
Line Contents: "Optional.ofNullable(message).map(Pattern::compile).orElse(null),"
Mutator: "org.pitest.mutationtest.engine.gregor.mutators.experimental.ArgumentPropagationMutator"
Description: "replaced call to java/util/Optional::orElse with argument"
Line Number: 81
Detected at https://github.com/checkstyle/checkstyle/pull/11437/files
All filters should migrate to use config inlined in Input files.
Suppression that was left in that commit should be removed.
we should not have not real tests, we should cover all functionalilty by full functional tests, to make sure xpath works to match real nodes.
all tests from XpathFilterElementTest should be converted to tests in SuppressionXpathSingleFilterTest where we load whole Input file with Check and Filter in header of file and confirm that violation is suppressed on required node.
Analysis from @Carbon14-48
testNonMatchingTokenType :
testNonMatchingColumnNumber:
testNullFileName:
testNonMatchingFileRegexp:
testNullViolation:
testDecideByMessage: