From 7a7381829afe22a985c79a73d07df60d67a8d48e Mon Sep 17 00:00:00 2001 From: Romain Pelisse Date: Sun, 8 Feb 2009 21:57:20 +0000 Subject: [PATCH] Final fix git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6824 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/rulesets/controversial.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pmd/rulesets/controversial.xml b/pmd/rulesets/controversial.xml index 4f8d2e0008..5c4621a98c 100644 --- a/pmd/rulesets/controversial.xml +++ b/pmd/rulesets/controversial.xml @@ -408,8 +408,16 @@ Avoid using final local variables, turn them into fields. +//LocalVariableDeclaration[ + @Final = 'true' + and + ( + (count(VariableDeclarator/VariableInitializer) = 0) + or + (VariableDeclarator/VariableInitializer/Expression/PrimaryExpression/PrimaryPrefix/Literal) + ) +] + ]]>