[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Tue Jan 2 08:13:21 EST 2007
User: msurtani
Date: 07/01/02 08:13:21
Modified: src/org/jboss/cache CacheImpl.java AbstractNode.java
Log:
- Fixed issues with AbstractNode.equals()
- Fixed NPE with Cache.getChildrenNames()
- Renamed TreeCacheMarshaller to CacheMarshaller to be in line with the Cache/CacheSPI naming
Revision Changes Path
1.6 +5 -2 JBossCache/src/org/jboss/cache/CacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- CacheImpl.java 1 Jan 2007 22:12:19 -0000 1.5
+++ CacheImpl.java 2 Jan 2007 13:13:20 -0000 1.6
@@ -98,7 +98,7 @@
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Brian Stansberry
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: CacheImpl.java,v 1.5 2007/01/01 22:12:19 msurtani Exp $
+ * @version $Id: CacheImpl.java,v 1.6 2007/01/02 13:13:20 msurtani Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
@@ -1027,7 +1027,9 @@
for (int i = 0; i < subtree.size(); i++)
{
name = subtree.get(i);
+ getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
child = (NodeSPI) parent.getChild(new Fqn(name));
+ getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
if (child == null)
{
// Lock the parent, create and add the child
@@ -1750,7 +1752,8 @@
public Set getChildrenNames(Fqn fqn) throws CacheException
{
MethodCall m = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal, fqn);
- return Collections.unmodifiableSet(new HashSet((Set) invokeMethod(m)));
+ Set retval = (Set) invokeMethod(m);
+ return retval == null ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet(retval));
}
public Set _getChildrenNames(Fqn fqn) throws CacheException
1.26 +6 -1 JBossCache/src/org/jboss/cache/AbstractNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractNode.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/AbstractNode.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- AbstractNode.java 1 Jan 2007 22:12:19 -0000 1.25
+++ AbstractNode.java 2 Jan 2007 13:13:21 -0000 1.26
@@ -40,7 +40,12 @@
public boolean equals(Object another)
{
- return another instanceof AbstractNode && fqn.equals(((AbstractNode) another).fqn);
+ if (another instanceof AbstractNode)
+ {
+ AbstractNode anotherNode = (AbstractNode) another;
+ return fqn == null && anotherNode.fqn == null || !(fqn == null || anotherNode.fqn == null) && fqn.equals(anotherNode.fqn);
+ }
+ return false;
}
public int hashCode()
More information about the jboss-cvs-commits
mailing list