From 44573d8bbed4a16564b430f9a87057acd1ebb644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 12 Apr 2019 16:57:03 -0300 Subject: [PATCH] [java] JUnitTestContainsTooManyAsserts uses XPath 2 - We are already using `pmd-java:typeIs`, so it's the correct thing to do. - Plus, this way it's 6X faster --- pmd-java/src/main/resources/category/java/bestpractices.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 92e683fd9a..1a8dfe3948 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -699,7 +699,7 @@ This rule checks for JUnit4, JUnit5 and TestNG Tests, as well as methods startin $maximumAsserts] + [count(..//PrimaryPrefix/Name[@Image[matches(.,'^assert')]]) > $maximumAsserts] ]]> +