Fixed: Fix some bugs Spotbugs reports
Fixes a Spotbugs worry and clarifies code
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,10 +211,8 @@ public final class UtilCacheEvents {
if (name == null) {
errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.couldNotClearCache", locale) + ".";
eventList.add(errMsg);
- }
-
+ } else {
UtilCache<?, ?> utilCache = UtilCache.findCache(name);
-
if (utilCache != null) {
utilCache.clear();
errMsg = UtilProperties.getMessage(ERR_RESOURCE, "utilCache.clearCache", UtilMisc.toMap("name", name), locale) + ".";
@@ -224,6 +223,7 @@ public final class UtilCacheEvents {
eventList.add(errMsg);
}
}
+ }
request.setAttribute("_EVENT_MESSAGE_LIST_", eventList);
return "success";
}
