svn commit: r1862321 - /ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1862321 - /ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java

mthl
Author: mthl
Date: Sat Jun 29 18:09:21 2019
New Revision: 1862321

URL: http://svn.apache.org/viewvc?rev=1862321&view=rev
Log:
Improved: Remove useless ‘null’ check in ‘EventFactory’
(OFBIZ-10911)

Modified:
    ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java

Modified: ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java?rev=1862321&r1=1862320&r2=1862321&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java Sat Jun 29 18:09:21 2019
@@ -21,7 +21,6 @@ package org.apache.ofbiz.webapp.event;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Set;
 
 import javax.servlet.ServletContext;
 
@@ -42,13 +41,11 @@ public class EventFactory {
     public EventFactory(ServletContext context, URL controllerConfigURL) {
         // load all the event handlers
         try {
-            Set<Map.Entry<String,String>> handlerEntries = ConfigXMLReader.getControllerConfig(controllerConfigURL).getEventHandlerMap().entrySet();
-            if (handlerEntries != null) {
-                for (Map.Entry<String,String> handlerEntry: handlerEntries) {
-                    EventHandler handler = (EventHandler) ObjectType.getInstance(handlerEntry.getValue());
-                    handler.init(context);
-                    this.handlers.put(handlerEntry.getKey(), handler);
-                }
+            Map<String,String> handlers = ConfigXMLReader.getControllerConfig(controllerConfigURL).getEventHandlerMap();
+            for (Map.Entry<String,String> handlerEntry: handlers.entrySet()) {
+                EventHandler handler = (EventHandler) ObjectType.getInstance(handlerEntry.getValue());
+                handler.init(context);
+                this.handlers.put(handlerEntry.getKey(), handler);
             }
         } catch (Exception e) {
             Debug.logError(e, module);