From c15ece60e2e9ff87fa9a52064c108fe4ee1923d0 Mon Sep 17 00:00:00 2001 From: Kristian Scheibe Date: Sat, 8 Dec 2018 16:18:50 +0100 Subject: [PATCH] LocalVariableCouldBeFinal: Added property to allow ignoring variables declared in a for-each statement. --- .../src/main/resources/category/java/codestyle.xml | 3 +++ .../codestyle/xml/LocalVariableCouldBeFinal.xml | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/pmd-java/src/main/resources/category/java/codestyle.xml b/pmd-java/src/main/resources/category/java/codestyle.xml index b5ded22baf..32af525984 100644 --- a/pmd-java/src/main/resources/category/java/codestyle.xml +++ b/pmd-java/src/main/resources/category/java/codestyle.xml @@ -1127,6 +1127,9 @@ public interface MissingProperSuffix extends javax.ejb.EJBLocalObject {} // n A local variable assigned only once can be declared final. 3 + + + + + Parameter to ignore non-final variables in for each loops (see #1513). + true + 0 + +