Merge pull request #3396 from oowekyala:update-ComparisonWithNaN

[java] Update rule ComparisonWithNaN #3396
This commit is contained in:
Andreas Dangel committed 2021-07-16 10:47:23 +02:00
commit ac73f85017
3 files changed
+2 -3

No files matched your search

+1 -1
View File
@@ -202,7 +202,7 @@
<!-- <rule ref="category/java/errorprone.xml/CloneThrowsCloneNotSupportedException"/> -->
<!-- <rule ref="category/java/errorprone.xml/CloseResource"/> -->
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals"/>
<!-- <rule ref="category/java/errorprone.xml/ComparisonWithNaN"/> -->
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod"/>
<!-- <rule ref="category/java/errorprone.xml/DataflowAnomalyAnalysis"/> -->
<!-- <rule ref="category/java/errorprone.xml/DetachedTestCase"/> -->
@@ -1146,7 +1146,7 @@ class Foo {
<property name="xpath">
<value>
<![CDATA[
(//EqualityExpression | //RelationalExpression)/PrimaryExpression/PrimaryPrefix/Name[@Image='Double.NaN' or @Image='Float.NaN']
//InfixExpression[@Operator = ("==", "!=", "<=", ">=", "<", ">")]/FieldAccess[@Name='NaN' and (pmd-java:typeIs('double') or pmd-java:typeIs('float'))]
]]>
</value>
</property>
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class ComparisonWithNaNTest extends PmdRuleTst {
// no additional unit tests
}