You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2021/11/18 16:14:40 UTC
[ofbiz-framework] 01/03: Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 5dfdb5095fe3d3b79f15c3726d6d304caf8c5032
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Thu Nov 18 13:26:15 2021 +0100
Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a Spotbugs worry and clarifies code
---
.../org/apache/ofbiz/webtools/UtilCacheEvents.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java
index 73299c0..1e45dfc 100644
--- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java
+++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java
@@ -19,10 +19,11 @@
package org.apache.ofbiz.webtools;
import java.util.Iterator;
-import java.util.Locale;
+import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
-import java.util.LinkedList;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -210,18 +211,17 @@ public final class UtilCacheEvents {
if (name == null) {
errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.couldNotClearCache", locale) + ".";
eventList.add(errMsg);
- }
-
- UtilCache<?, ?> utilCache = UtilCache.findCache(name);
-
- if (utilCache != null) {
- utilCache.clear();
- errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.clearCache", UtilMisc.toMap("name", name), locale) + ".";
- eventList.add(errMsg);
} else {
- errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.couldNotClearCacheNotFoundName",
- UtilMisc.toMap("name", name), locale) + ".";
- eventList.add(errMsg);
+ UtilCache<?, ?> utilCache = UtilCache.findCache(name);
+ if (utilCache != null) {
+ utilCache.clear();
+ errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.clearCache", UtilMisc.toMap("name", name), locale) + ".";
+ eventList.add(errMsg);
+ } else {
+ errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.couldNotClearCacheNotFoundName",
+ UtilMisc.toMap("name", name), locale) + ".";
+ eventList.add(errMsg);
+ }
}
}
request.setAttribute("_EVENT_MESSAGE_LIST_", eventList);