From 3dc159b59b2fa0e5f0a7f3696318249b044a8ee4 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 19 Feb 2007 19:47:18 +0000 Subject: [PATCH] Why fail when we can just complain without loss of integrity. --- .../samskivert/jdbc/depot/PersistenceContext.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/jdbc/depot/PersistenceContext.java b/src/java/com/samskivert/jdbc/depot/PersistenceContext.java index 24a1125..eed1416 100644 --- a/src/java/com/samskivert/jdbc/depot/PersistenceContext.java +++ b/src/java/com/samskivert/jdbc/depot/PersistenceContext.java @@ -236,6 +236,11 @@ public class PersistenceContext */ public void cacheStore (CacheKey key, T entry) { + if (key == null) { + Log.warning("Cache key must not be null [entry=" + entry + "]"); + Thread.dumpStack(); + return; + } Log.debug("cacheStore: entry [key=" + key + ", value=" + entry + "]"); // find the old entry, if any @@ -264,7 +269,12 @@ public class PersistenceContext */ public void cacheInvalidate (CacheKey key) { - cacheInvalidate(key.getCacheId(), key.getCacheKey()); + if (key == null) { + Log.warning("Cache key to invalidate must not be null."); + Thread.dumpStack(); + } else { + cacheInvalidate(key.getCacheId(), key.getCacheKey()); + } } /**