Author: manik.surtani(a)jboss.com
Date: 2008-06-30 20:21:12 -0400 (Mon, 30 Jun 2008)
New Revision: 6132
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyFqnTransformerTest.java
Log:
Ported Brian's 2.2.X patch to trunk
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-06-30
19:22:09 UTC (rev 6131)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-07-01
00:21:12 UTC (rev 6132)
@@ -1,11 +1,11 @@
package org.jboss.cache.buddyreplication;
+import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
-import org.jboss.cache.CacheException;
import org.jgroups.Address;
+import java.util.ArrayList;
import java.util.List;
-import java.util.ArrayList;
/**
* Knows how to transform between fqn and buddy-formated fqns.
@@ -145,7 +145,7 @@
*/
public Fqn getBackupRootFromFqn(Fqn fqn)
{
- if (isBackupFqn(fqn))
+ if (isBackupFqn(fqn) && fqn.size() > 1)
{
return fqn.getSubFqn(0, isDeadBackupFqn(fqn) ? 3 : 2);
}
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyFqnTransformerTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyFqnTransformerTest.java 2008-06-30
19:22:09 UTC (rev 6131)
+++
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyFqnTransformerTest.java 2008-07-01
00:21:12 UTC (rev 6132)
@@ -34,4 +34,9 @@
{
assert Fqn.ROOT ==
buddyFqnTransformer.getActualFqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
}
+
+ public void testBackupRootFromFqnOnBuddyBackupRoot()
+ {
+ assert Fqn.ROOT ==
buddyFqnTransformer.getBackupRootFromFqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
+ }
}
Show replies by date