From 77fbd275500f41bd674caa9590ba3c2fe225f735 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 8 Oct 2021 10:58:47 +0200 Subject: [PATCH] [java] Update rule JumbledIncrementer --- .ci/files/all-java.xml | 2 +- .../main/resources/category/java/errorprone.xml | 12 ++++++------ .../rule/errorprone/JumbledIncrementerTest.java | 1 - .../rule/errorprone/xml/JumbledIncrementer.xml | 15 ++++++++------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.ci/files/all-java.xml b/.ci/files/all-java.xml index 936df30194..cdfba2b22a 100644 --- a/.ci/files/all-java.xml +++ b/.ci/files/all-java.xml @@ -232,7 +232,7 @@ - + diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 5c2ed3e6ce..17254931ab 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2108,18 +2108,18 @@ LOGGER.error("param {}", "arg1", new IllegalStateException("arg")); //The except class="net.sourceforge.pmd.lang.rule.XPathRule" externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_errorprone.html#jumbledincrementer"> -Avoid jumbled loop incrementers - its usually a mistake, and is confusing even if intentional. +Avoid jumbled loop incrementers - it's usually a mistake, and is confusing even if intentional. 3 diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java index 178d0eac7e..90f349f243 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java @@ -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 JumbledIncrementerTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JumbledIncrementer.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JumbledIncrementer.xml index c065b9ee85..737fba08cb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JumbledIncrementer.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JumbledIncrementer.xml @@ -5,8 +5,9 @@ xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd"> - 1 + nested loop, wrong incrementer 1 + 4 - 2 + correct incrementer in nested loop 0 - 3 + loops with and without incrementer - all ok 0 - using outer loop incrementor as array index is OK + using outer loop incrementer as array index is OK 0 - +