From eb7903d96355fc503191fb691e5dcb03edc44821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 12 Apr 2019 17:27:45 -0300 Subject: [PATCH] [java] Fix NoPackage rule - Also make it's search much more precise, making it 10X faster --- pmd-java/src/main/resources/category/java/codestyle.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmd-java/src/main/resources/category/java/codestyle.xml b/pmd-java/src/main/resources/category/java/codestyle.xml index 8421462853..9643356624 100644 --- a/pmd-java/src/main/resources/category/java/codestyle.xml +++ b/pmd-java/src/main/resources/category/java/codestyle.xml @@ -1359,8 +1359,9 @@ Detects when a class or interface does not have a package definition. 3 - //ClassOrInterfaceDeclaration[count(preceding::PackageDeclaration) = 0] + /CompilationUnit[not(./PackageDeclaration)]/TypeDeclaration[1] +