Author: manik.surtani(a)jboss.com
Date: 2008-08-19 05:37:15 -0400 (Tue, 19 Aug 2008)
New Revision: 6579
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/MVCCInvocationContext.java
Log:
Copy and reset to consider lazily initialized node map
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/MVCCInvocationContext.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/MVCCInvocationContext.java 2008-08-19
09:36:47 UTC (rev 6578)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/MVCCInvocationContext.java 2008-08-19
09:37:15 UTC (rev 6579)
@@ -17,7 +17,7 @@
*/
public class MVCCInvocationContext extends AbstractInvocationContext
{
- private Map<Fqn, NodeSPI> lookedUpNodes = null;
+ private HashMap<Fqn, NodeSPI> lookedUpNodes = null;
private MVCCTransactionContext mvccTCtx;
@Override
@@ -96,14 +96,19 @@
public void reset()
{
super.reset();
- lookedUpNodes.clear();
+ if (lookedUpNodes != null)
+ {
+ lookedUpNodes.clear();
+ lookedUpNodes = null;
+ }
}
+ @SuppressWarnings("unchecked")
public InvocationContext copy()
{
MVCCInvocationContext copy = new MVCCInvocationContext();
doCopy(copy);
- copy.lookedUpNodes.putAll(lookedUpNodes);
+ if (lookedUpNodes != null) copy.lookedUpNodes = (HashMap<Fqn, NodeSPI>)
lookedUpNodes.clone();
return copy;
}
}
Show replies by date