Author: manik.surtani(a)jboss.com
Date: 2008-06-27 08:28:47 -0400 (Fri, 27 Jun 2008)
New Revision: 6092
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
Log:
NPE in rollback
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-06-27
12:17:15 UTC (rev 6091)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-06-27
12:28:47 UTC (rev 6092)
@@ -104,13 +104,15 @@
private void move(Fqn toMoveFqn, Fqn newParentFqn, boolean skipNotifications,
InvocationContext ctx)
{
// the actual move algorithm.
- NodeSPI newParent = ctx.lookUpNode(newParentFqn);
+ // ctx *could* be null if this is a rollback!!! Sucks big time.
+ NodeSPI newParent = ctx == null ? dataContainer.peek(newParentFqn) :
ctx.lookUpNode(newParentFqn);
if (newParent == null)
{
throw new NodeNotExistsException("New parent node " + newParentFqn +
" does not exist when attempting to move node!!");
}
- NodeSPI node = ctx.lookUpNode(toMoveFqn);
+ // ctx *could* be null if this is a rollback!!! Sucks big time.
+ NodeSPI node = ctx == null ? dataContainer.peek(toMoveFqn) :
ctx.lookUpNode(toMoveFqn);
if (node == null)
{