From 8cdc5bd985619ec57f1d857258d7b4272fbd7374 Mon Sep 17 00:00:00 2001 From: Xavier Le Vourch Date: Thu, 27 Nov 2008 17:36:03 +0000 Subject: [PATCH] code cleanup: better XPath expression for ClassWithOnlyPrivateConstructorsShouldBeFinal git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6704 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/rulesets/design.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmd/rulesets/design.xml b/pmd/rulesets/design.xml index 720b7afefe..960f935145 100644 --- a/pmd/rulesets/design.xml +++ b/pmd/rulesets/design.xml @@ -1407,9 +1407,7 @@ constructor is called by a inner class. TypeDeclaration[count(../TypeDeclaration) = 1]/ClassOrInterfaceDeclaration [@Final = 'false'] [count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[@Private = 'true']) >= 1 ] -[count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[@Public = 'true']) + -count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[@Protected = 'true']) + -count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[@PackagePrivate = 'true']) = 0 ] +[count(./ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/ConstructorDeclaration[(@Public = 'true') or (@Protected = 'true') or (@PackagePrivate = 'true')]) = 0] [not(.//ClassOrInterfaceDeclaration)] ]]>