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 17, 2022
1 parent 21d1219 commit 3d9c6ef
Show file tree
Hide file tree
Showing 18 changed files with 674 additions and 583 deletions.
Expand Up @@ -6271,7 +6271,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 @@ -6282,7 +6282,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 @@ -6293,7 +6293,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 @@ -6305,28 +6305,17 @@

<checkerFrameworkError unstable="false">
<fileName>checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/xpath/ElementNode.java</fileName>
<specifier>argument</specifier>
<message>incompatible argument for parameter value of AttributeNode.</message>
<lineContent>private static final AttributeNode ATTRIBUTE_NODE_UNINITIALIZED = new AttributeNode(null, null);</lineContent>
<details>
found : null (NullType)
required: @Initialized @NonNull String
</details>
</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>
<specifier>return</specifier>
<message>incompatible types in return.</message>
<lineContent>return result;</lineContent>
<details>
found : null (NullType)
required: @Initialized @NonNull AttributeNode
type of expression: @Initialized @Nullable AttributeNode
method return type: @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>
Expand All @@ -6351,21 +6340,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 @@ -6376,7 +6365,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 @@ -6387,7 +6376,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
70 changes: 17 additions & 53 deletions .ci/pitest-suppressions/pitest-xpath-suppressions.xml
@@ -1,32 +1,32 @@
<?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>
</mutation>

<mutation unstable="false">
<sourceFile>ElementNode.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.xpath.ElementNode</mutatedClass>
<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>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 +90,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 3d9c6ef

Please sign in to comment.