Skip to content
Permalink
Browse files

Improved: Remove useless ‘null’ check in ‘EventFactory’

(OFBIZ-10911)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862321 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jun 29, 2019
1 parent c5ea5d8 commit 3fcf744748cf4cc61b94946dc3ec0ee56d0bf28f
Showing with 5 additions and 8 deletions.
  1. +5 −8 framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/EventFactory.java
@@ -21,7 +21,6 @@
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 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);

0 comments on commit 3fcf744

Please sign in to comment.
You can’t perform that action at this time.