[java] Update rule DontUseFloatTypeForLoopIndices

This commit is contained in:
Andreas Dangel
2021-10-08 11:07:18 +02:00
parent 34b41a952c
commit 45e291a7cb
4 changed files with 3 additions and 4 deletions

View File

@@ -209,7 +209,7 @@
<!-- <rule ref="category/java/errorprone.xml/DoNotHardCodeSDCard"/> -->
<!-- <rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally"/> -->
<rule ref="category/java/errorprone.xml/DontImportSun"/>
<!-- <rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/> -->
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock"/>
<rule ref="category/java/errorprone.xml/EmptyFinalizer"/>
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock"/>

View File

@@ -1441,8 +1441,7 @@ performance need (space or time).
<property name="xpath">
<value>
<![CDATA[
//ForStatement/ForInit/LocalVariableDeclaration
/Type/PrimitiveType[@Image="float"]
//ForStatement/ForInit//VariableDeclaratorId[pmd-java:typeIs('float')]
]]>
</value>
</property>

View File

@@ -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 DontUseFloatTypeForLoopIndicesTest extends PmdRuleTst {
// no additional unit tests
}

View File

@@ -7,6 +7,7 @@
<test-code>
<description>basic test case</description>
<expected-problems>1</expected-problems>
<expected-linenumbers>5</expected-linenumbers>
<code><![CDATA[
public class Count {
public static void main(String[] args) {