(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 17 Jul 2010 21:36:22 +0000 (21:36 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 17 Jul 2010 21:36:22 +0000 (21:36 +0000)
support/general/src/main/java/org/wamblee/cache/CachedObject.java

index 87feaf0e003f957d0f3310071fae9aab47c4cac4..7ec87534f08e521ec5c95bcccc6ec4b0479277a0 100644 (file)
@@ -112,7 +112,7 @@ public class CachedObject<KeyType extends Serializable, ValueType extends Serial
 
             synchronized (this) {
                 value = object;
-            }
+            } 
         } catch (Exception e) {
             LOGGER.log(Level.INFO,
                 "Recomputation of cached item failed for key '" + objectKey +
@@ -122,8 +122,9 @@ public class CachedObject<KeyType extends Serializable, ValueType extends Serial
                 computing = false;
             }
         }
-
-        return value;
+        synchronized(this) { 
+            return value; 
+        }
     }
 
     /**