(no commit message)
[utils] / 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; 
+        }
     }
 
     /**