From 33fc03fa10734455e96ff51936d30ad4c8961d2d Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Thu, 4 Jul 2024 18:12:17 +0200 Subject: [PATCH] Fixed: Fix some bugs SpotBugs reports (OFBIZ-12386) After updating SpotBugs plugin to 4.8.6.r202406180231-6cf7b2c in Eclipse 2023-03 (4.27.0) it reported: <> As it's also used by WebAppCacheTest class I made it package. That's safer but not enough so I also put it in exclude.xml Also Chekstyle wants it to be final --- .../src/main/java/org/apache/ofbiz/webapp/WebAppCache.java | 4 ++-- spotbugs/exclude.xml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/WebAppCache.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/WebAppCache.java index dd5f543b535..8095538d6a9 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/WebAppCache.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/WebAppCache.java @@ -45,7 +45,7 @@ * * @see Memoization */ -public class WebAppCache { +public final class WebAppCache { // Synchronized map storing web applications. // The LinkedHashMap is used to maintain insertion order (which client code depends on). // There is no concurrent implementation of LinkedHashMap, so we are using manual synchronization instead. @@ -57,7 +57,7 @@ public class WebAppCache { * Constructs an empty web application cache. * @param supplier the source from which components configurations are retrieved */ - public WebAppCache(Supplier> supplier) { + WebAppCache(Supplier> supplier) { ccs = supplier; serverWebApps = new LinkedHashMap<>(); } diff --git a/spotbugs/exclude.xml b/spotbugs/exclude.xml index a338b4c8236..ec375974730 100644 --- a/spotbugs/exclude.xml +++ b/spotbugs/exclude.xml @@ -192,4 +192,10 @@ under the License. + + + + + +