From d80cccd6bf3b035082d8590af2ce3e1b3f890881 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 24 Aug 2007 01:46:40 +0000 Subject: [PATCH] I'm assuming it's valid for a CachedValue to exist but have a null value as we properly ignore those elsewhere, so we should ignore them when traversing the cache as well. --- src/java/com/samskivert/jdbc/depot/PersistenceContext.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/PersistenceContext.java b/src/java/com/samskivert/jdbc/depot/PersistenceContext.java index 3b910bb..962b1bf 100644 --- a/src/java/com/samskivert/jdbc/depot/PersistenceContext.java +++ b/src/java/com/samskivert/jdbc/depot/PersistenceContext.java @@ -416,8 +416,9 @@ public class PersistenceContext if (bin != null) { for (Object key : bin.enumerateKeys()) { CacheAdapter.CachedValue element = bin.lookup((Serializable) key); - if (element != null) { - filter.visitCacheEntry(this, cacheId, (Serializable) key, element.getValue()); + T value; + if (element != null && (value = element.getValue()) != null) { + filter.visitCacheEntry(this, cacheId, (Serializable) key, value); } } }