Why fail when we can just complain without loss of integrity.

This commit is contained in:
Michael Bayne
2007-02-19 19:47:18 +00:00
parent 853c6f8b81
commit 3dc159b59b
@@ -236,6 +236,11 @@ public class PersistenceContext
*/ */
public <T> void cacheStore (CacheKey key, T entry) public <T> 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 + "]"); Log.debug("cacheStore: entry [key=" + key + ", value=" + entry + "]");
// find the old entry, if any // find the old entry, if any
@@ -264,7 +269,12 @@ public class PersistenceContext
*/ */
public void cacheInvalidate (CacheKey key) 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());
}
} }
/** /**