Author: manik.surtani(a)jboss.com
Date: 2008-06-25 11:57:45 -0400 (Wed, 25 Jun 2008)
New Revision: 6041
Modified:
core/trunk/src/main/java/org/jboss/cache/InvocationContext.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionContext.java
Log:
Null chks
Modified: core/trunk/src/main/java/org/jboss/cache/InvocationContext.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/InvocationContext.java 2008-06-25 15:39:25
UTC (rev 6040)
+++ core/trunk/src/main/java/org/jboss/cache/InvocationContext.java 2008-06-25 15:57:45
UTC (rev 6041)
@@ -202,7 +202,7 @@
{
// first check transactional scope
if (transactionContext != null) return transactionContext.getLocks();
- return Collections.unmodifiableList(new ArrayList(invocationLocks));
+ return invocationLocks == null ? Collections.emptyList() :
Collections.unmodifiableList(new ArrayList(invocationLocks));
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionContext.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionContext.java 2008-06-25
15:39:25 UTC (rev 6040)
+++
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionContext.java 2008-06-25
15:57:45 UTC (rev 6041)
@@ -267,7 +267,7 @@
@SuppressWarnings("unchecked")
public List getLocks()
{
- return Collections.unmodifiableList(new ArrayList(transactionLocks));
+ return transactionLocks == null ? Collections.emptyList() :
Collections.unmodifiableList(new ArrayList(transactionLocks));
}
@@ -455,7 +455,7 @@
if (modificationList != null) modificationList = null;
if (localModifications != null) localModifications = null;
option = null;
- transactionLocks.clear();
+ if (transactionLocks != null) transactionLocks.clear();
if (dummyNodesCreatedByCacheLoader != null)
dummyNodesCreatedByCacheLoader.clear();
removedNodes.clear();
}