svn commit: r930734 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util: collections/FlexibleMapAccessor.java string/FlexibleStringExpander.java

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

svn commit: r930734 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util: collections/FlexibleMapAccessor.java string/FlexibleStringExpander.java

doogie-3
Author: doogie
Date: Sun Apr  4 19:08:27 2010
New Revision: 930734

URL: http://svn.apache.org/viewvc?rev=930734&view=rev
Log:
Remove synchronized blocks when fetching/creating instances into the
local caches.  It's not important to make certain there is only one
constructed instance.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java?rev=930734&r1=930733&r2=930734&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java Sun Apr  4 19:08:27 2010
@@ -86,10 +86,8 @@ public class FlexibleMapAccessor<T> impl
         }
         FlexibleMapAccessor fma = fmaCache.get(original);
         if (fma == null) {
-            synchronized (fmaCache) {
-                fmaCache.put(original, new FlexibleMapAccessor(original));
-                fma = fmaCache.get(original);
-            }
+            fmaCache.put(original, new FlexibleMapAccessor(original));
+            fma = fmaCache.get(original);
         }
         return fma;
     }

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java?rev=930734&r1=930733&r2=930734&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java Sun Apr  4 19:08:27 2010
@@ -184,10 +184,8 @@ public abstract class FlexibleStringExpa
         Key key = chars.length == length ? new SimpleKey(chars) : new OffsetKey(chars, offset, length);
         FlexibleStringExpander fse = exprCache.get(key);
         if (fse == null) {
-            synchronized (exprCache) {
-                fse = parse(chars, offset, length);
-                exprCache.put(key, fse);
-            }
+            exprCache.put(key, parse(chars, offset, length));
+            fse = exprCache.get(key);
         }
         return fse;
     }