Check whether lock is null before logging, as it will probably be

This commit is contained in:
Alex Snaps 2011-09-25 12:38:50 -07:00 committed by Strong Liu
parent 0669057f0a
commit 3fe833456b
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ abstract class AbstractReadWriteEhcacheAccessStrategy<T extends EhcacheTransacti
* Handle the timeout of a previous lock mapped to this key * Handle the timeout of a previous lock mapped to this key
*/ */
protected void handleLockExpiry(Object key, Lockable lock) { protected void handleLockExpiry(Object key, Lockable lock) {
LOG.softLockedCacheExpired( region.getName(), key, lock.toString() ); LOG.softLockedCacheExpired( region.getName(), key, lock == null ? "(null)" : lock.toString() );
long ts = region.nextTimestamp() + region.getTimeout(); long ts = region.nextTimestamp() + region.getTimeout();
// create new lock that times out immediately // create new lock that times out immediately