Added missed opportunity to cache a value during updateValue()

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16268 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-09-15 10:02:30 +00:00
parent aac27e65e5
commit 9d6d25b60a

View File

@@ -520,15 +520,13 @@ public class EntityLookupCache<K extends Serializable, V extends Object, VK exte
// Get the value key.
VK valueKey = (value == null) ? (VK)VALUE_NULL : entityLookup.getValueKey(value);
// Check if the value has a good key
if (valueKey == null)
if (valueKey != null)
{
// No good key, so no caching
return updateCount;
// There is a good value key, cache by value
CacheRegionValueKey valueCacheKey = new CacheRegionValueKey(cacheRegion, valueKey);
cache.put(valueCacheKey, key);
}
// Cache the key and value
CacheRegionValueKey valueCacheKey = new CacheRegionValueKey(cacheRegion, valueKey);
cache.put(valueCacheKey, key);
// Cache by key
cache.put(
new CacheRegionKey(cacheRegion, key),
(value == null ? VALUE_NULL : value));