Skip to content

Commit

Permalink
Issue checkstyle#11604: separates detail ast from xpath
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach committed Oct 2, 2022
1 parent b6f2551 commit 845f588
Show file tree
Hide file tree
Showing 18 changed files with 703 additions and 576 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5773,7 +5773,7 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>argument</specifier>
<message>incompatible argument for parameter name of AttributeNode.</message>
<lineContent>private static final AttributeNode ATTRIBUTE_NODE_UNINITIALIZED = new AttributeNode(null, null);</lineContent>
Expand All @@ -5784,7 +5784,7 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>argument</specifier>
<message>incompatible argument for parameter nodes of OfNodes.</message>
<lineContent>getChildren().toArray(EMPTY_ABSTRACT_NODE_ARRAY));</lineContent>
Expand All @@ -5795,7 +5795,7 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>argument</specifier>
<message>incompatible argument for parameter nodes of OfNodes.</message>
<lineContent>getFollowingSiblings().toArray(EMPTY_ABSTRACT_NODE_ARRAY));</lineContent>
Expand All @@ -5817,25 +5817,14 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<specifier>assignment</specifier>
<message>incompatible types in assignment.</message>
<lineContent>attributeNode = null;</lineContent>
<details>
found : null (NullType)
required: @Initialized @NonNull AttributeNode
</details>
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>not.interned</specifier>
<message>attempting to use a non-@Interned comparison operand</message>
<lineContent>if (attributeNode == ATTRIBUTE_NODE_UNINITIALIZED) {</lineContent>
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>return</specifier>
<message>incompatible types in return.</message>
<lineContent>return result;</lineContent>
Expand All @@ -5846,21 +5835,21 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>toarray.nullable.elements.not.newarray</specifier>
<message>call of toArray on collection of non-null elements yields an array of possibly-null elements; omit the argument to toArray or make it an explicit array constructor</message>
<lineContent>getChildren().toArray(EMPTY_ABSTRACT_NODE_ARRAY));</lineContent>
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java</fileName>
<specifier>toarray.nullable.elements.not.newarray</specifier>
<message>call of toArray on collection of non-null elements yields an array of possibly-null elements; omit the argument to toArray or make it an explicit array constructor</message>
<lineContent>getFollowingSiblings().toArray(EMPTY_ABSTRACT_NODE_ARRAY));</lineContent>
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/RootNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractRootNode.java</fileName>
<specifier>argument</specifier>
<message>incompatible argument for parameter nodes of OfNodes.</message>
<lineContent>getChildren().toArray(EMPTY_ABSTRACT_NODE_ARRAY));</lineContent>
Expand All @@ -5871,7 +5860,7 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/RootNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractRootNode.java</fileName>
<specifier>return</specifier>
<message>incompatible types in return.</message>
<lineContent>return null;</lineContent>
Expand All @@ -5882,7 +5871,7 @@
</checkerFrameworkError>

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/RootNode.java</fileName>
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractRootNode.java</fileName>
<specifier>toarray.nullable.elements.not.newarray</specifier>
<message>call of toArray on collection of non-null elements yields an array of possibly-null elements; omit the argument to toArray or make it an explicit array constructor</message>
<lineContent>getChildren().toArray(EMPTY_ABSTRACT_NODE_ARRAY));</lineContent>
Expand Down
100 changes: 50 additions & 50 deletions .ci/pitest-suppressions/pitest-xpath-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>
<mutation unstable="false">
<sourceFile>DescendantIterator.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.iterators.DescendantIterator</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable descendantEnum</description>
<lineContent>descendantEnum = null;</lineContent>
<sourceFile>AbstractElementNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.AbstractElementNode</mutatedClass>
<mutatedMethod>getPrecedingSiblings</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.ArgumentPropagationMutator</mutator>
<description>replaced call to java/util/Collections::unmodifiableList with argument</description>
<lineContent>return Collections.unmodifiableList(siblings.subList(0, indexAmongSiblings));</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>ElementNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.ElementNode</mutatedClass>
<mutatedMethod>getAttributeNode</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable attributeNode</description>
<lineContent>attributeNode = null;</lineContent>
<sourceFile>AbstractElementNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.AbstractElementNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_8</mutator>
<description>RemoveSwitch 8 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AbstractRootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.AbstractRootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_1</mutator>
<description>RemoveSwitch 1 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>ElementNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.ElementNode</mutatedClass>
<sourceFile>AbstractRootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.AbstractRootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_2</mutator>
<description>RemoveSwitch 2 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AbstractRootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.AbstractRootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_5</mutator>
<description>RemoveSwitch 5 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AbstractRootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.AbstractRootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_8</mutator>
<description>RemoveSwitch 8 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>DescendantIterator.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.iterators.DescendantIterator</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable descendantEnum</description>
<lineContent>descendantEnum = null;</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>FollowingIterator.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.iterators.FollowingIterator</mutatedClass>
Expand Down Expand Up @@ -90,42 +126,6 @@
<lineContent>return detailAst.getColumnNo();</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.RootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_1</mutator>
<description>RemoveSwitch 1 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.RootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_2</mutator>
<description>RemoveSwitch 2 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.RootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_5</mutator>
<description>RemoveSwitch 5 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RootNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.RootNode</mutatedClass>
<mutatedMethod>iterateAxis</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.RemoveSwitchMutator_8</mutator>
<description>RemoveSwitch 8 mutation</description>
<lineContent>switch (axisNumber) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>XpathQueryGenerator.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.XpathQueryGenerator</mutatedClass>
Expand Down

0 comments on commit 845f588

Please sign in to comment.