Author: lektran
Date: Mon Jun 27 23:39:00 2011
New Revision: 1140375
URL:
http://svn.apache.org/viewvc?rev=1140375&view=revLog:
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);
}
}
}