Author: mbrohl
Date: Sun Dec 10 09:35:12 2017
New Revision: 1817680
URL:
http://svn.apache.org/viewvc?rev=1817680&view=revLog:
Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.content.layout.
(OFBIZ-9812)
Thanks Julian Leichert for reporting and providing the patch.
Modified:
ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java
Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java?rev=1817680&r1=1817679&r2=1817680&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java Sun Dec 10 09:35:12 2017
@@ -77,7 +77,7 @@ public class LayoutEvents {
String imageFileName = (String) uploadResults.get("imageFileName");
String imageFileNameExt = null;
if (UtilValidate.isNotEmpty(imageFileName)) {
- int pos = imageFileName.lastIndexOf(".");
+ int pos = imageFileName.lastIndexOf('.');
if (pos >= 0) {
imageFileNameExt = imageFileName.substring(pos + 1);
}
@@ -420,7 +420,7 @@ public class LayoutEvents {
Debug.logVerbose("in createSubContent, mapKey:" + mapKey, module);
}
Map<String, Object> context = new HashMap<String, Object>();
- List<Object> errorMessages = null;
+ List<Object> errorMessages = new LinkedList<>();
Locale loc = (Locale) request.getSession().getServletContext().getAttribute("locale");
if (loc == null) {
loc = Locale.getDefault();
@@ -488,7 +488,7 @@ public class LayoutEvents {
HttpSession session = request.getSession();
Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
Map<String, Object> context = new HashMap<String, Object>();
- List<Object> errorMessages = null;
+ List<Object> errorMessages = new LinkedList<>();
Locale loc = (Locale) request.getSession().getServletContext().getAttribute("locale");
if (loc == null) {
loc = Locale.getDefault();