This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git

commit eb6561d2104e8cbc710585bfd920dec5a34cfc71
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sun Feb 9 18:17:44 2025 -0500

    Add Checkstyle FinalLocalVariable
---
 src/conf/checkstyle.xml                                               | 1 +
 .../apache/commons/collections4/map/ConcurrentReferenceHashMap.java   | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml
index 5dd93d44d..bae81d016 100644
--- a/src/conf/checkstyle.xml
+++ b/src/conf/checkstyle.xml
@@ -59,6 +59,7 @@ limitations under the License.
     <module name="EqualsHashCode" />
     <module name="ExplicitInitialization" />
     <module name="FallThrough" />
+    <module name="FinalLocalVariable" />
     <module name="GenericWhitespace"/>
     <module name="IllegalImport"/>
     <module name="ImportOrder">
diff --git 
a/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java
 
b/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java
index 232c41bc0..57dcf4f1d 100644
--- 
a/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java
+++ 
b/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java
@@ -814,7 +814,7 @@ public class ConcurrentReferenceHashMap<K, V> extends 
AbstractMap<K, V> implemen
                 for (int i = 0; i < len; i++) {
                     for (HashEntry<K, V> e = tab[i]; e != null; e = e.next) {
                         final Object opaque = e.valueRef;
-                        V v;
+                        final V v;
                         if (opaque == null) {
                             // recheck
                             v = readValueUnderLock(e);
@@ -901,7 +901,7 @@ public class ConcurrentReferenceHashMap<K, V> extends 
AbstractMap<K, V> implemen
             while (e != null && (e.hash != hash || !keyEq(key, e.key()))) {
                 e = e.next;
             }
-            V resultValue;
+            final V resultValue;
             if (e != null) {
                 resultValue = e.value();
                 if (!onlyIfAbsent) {

Reply via email to