Author: doogie
Date: Wed Apr 18 23:48:01 2012
New Revision: 1327729
URL:
http://svn.apache.org/viewvc?rev=1327729&view=revLog:
OPTIMIZE: runLog can never be null, it's a static final; if for some
reason that fails at class init time, then an exception will be thrown
then, and the class will not be usable.
Modified:
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=1327729&r1=1327728&r2=1327729&view=diff==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Wed Apr 18 23:48:01 2012
@@ -1059,20 +1059,16 @@ public class ServiceDispatcher {
private RunningService logService(String localName, ModelService modelService, int mode) {
// set up the running service log
RunningService rs = new RunningService(localName, modelService, mode);
- if (runLog == null) {
- Debug.logWarning("LRUMap is null", module);
- } else {
- synchronized(runLog) {
+ synchronized(runLog) {
+ try {
+ runLog.put(rs, this);
+ } catch (Throwable t) {
+ Debug.logWarning("LRUMap problem; resetting LRU [" + runLog.size() + "]", module);
+ runLog.clear();
try {
runLog.put(rs, this);
- } catch (Throwable t) {
- Debug.logWarning("LRUMap problem; resetting LRU [" + runLog.size() + "]", module);
- runLog.clear();
- try {
- runLog.put(rs, this);
- } catch (Throwable t2) {
- Debug.logError(t2, "Unable to put() in reset LRU map!", module);
- }
+ } catch (Throwable t2) {
+ Debug.logError(t2, "Unable to put() in reset LRU map!", module);
}
}
}