svn commit: r1140375 - /ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java

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

svn commit: r1140375 - /ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java

lektran
Author: lektran
Date: Mon Jun 27 23:39:00 2011
New Revision: 1140375

URL: http://svn.apache.org/viewvc?rev=1140375&view=rev
Log:
Fix null check against a variable that was guranteed to be null, looks like a bug introduced during refactoring a while ago.  The code now correctly tries to get the LocalDispatcher from the ServiceDispatcher before creating a new instance.

Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java?rev=1140375&r1=1140374&r2=1140375&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java Mon Jun 27 23:39:00 2011
@@ -78,19 +78,15 @@ public class GenericDispatcher extends G
                     }
 
                     ServiceDispatcher sd = serviceDispatcher != null ? serviceDispatcher : ServiceDispatcher.getInstance(dispatcherName, delegator);
-                    LocalDispatcher thisDispatcher = null;
+
                     if (sd != null) {
                         dispatcher = sd.getLocalDispatcher(dispatcherName);
                     }
-                    if (thisDispatcher == null) {
+                    if (dispatcher == null) {
                         dispatcher = new GenericDispatcher(dispatcherName, delegator, readerURLs, loader, sd);
                     }
 
-                    if (dispatcher != null) {
-                        dispatcherCache.put(dispatcherName, dispatcher);
-                    } else {
-                        Debug.logError("Could not create dispatcher with name " + dispatcherName + ", constructor failed (got null value) not sure why/how.", module);
-                    }
+                    dispatcherCache.put(dispatcherName, dispatcher);
                 }
             }
         }