From 968a0d8f0242d398279defb7d86b034e4f2dbb43 Mon Sep 17 00:00:00 2001 From: mdb 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. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2214 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- 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 3b910bb1..962b1bfd 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); } } }