[jboss-cvs] JBossCache/src/org/jboss/cache ...

Manik Surtani manik at jboss.org
Tue Mar 6 15:09:35 EST 2007


  User: msurtani
  Date: 07/03/06 15:09:35

  Modified:    src/org/jboss/cache  Tag: Branch_JBossCache_1_4_0
                        TreeCache.java
  Log:
  nullcheck on child set + same treatment for evicting root as removing
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.195.2.53 +23 -5     JBossCache/src/org/jboss/cache/Attic/TreeCache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Attic/TreeCache.java,v
  retrieving revision 1.195.2.52
  retrieving revision 1.195.2.53
  diff -u -b -r1.195.2.52 -r1.195.2.53
  --- TreeCache.java	5 Mar 2007 19:15:16 -0000	1.195.2.52
  +++ TreeCache.java	6 Mar 2007 20:09:34 -0000	1.195.2.53
  @@ -99,7 +99,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: TreeCache.java,v 1.195.2.52 2007/03/05 19:15:16 msurtani Exp $
  + * @version $Id: TreeCache.java,v 1.195.2.53 2007/03/06 20:09:34 msurtani Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -3855,11 +3855,14 @@
         {
            // special treatment for removal of root node - just remove all children
            Set children = getChildrenNames(fqn);
  +         if (children != null)
  +         {
            for (Iterator i = children.iterator(); i.hasNext();)
            {
               remove(new Fqn(fqn, i.next()));
            }
         }
  +      }
         else
         {
            MethodCall m = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, new Object[]{tx, fqn, Boolean.TRUE});
  @@ -3879,9 +3882,24 @@
       */
      public void evict(Fqn fqn) throws CacheException
      {
  +      if (fqn.isRoot())
  +      {
  +         // special treatment for removal of root node - just remove all children
  +         Set children = getChildrenNames(fqn);
  +         if (children != null)
  +         {
  +            for (Iterator i = children.iterator(); i.hasNext();)
  +            {
  +               evict(new Fqn(fqn, i.next()));
  +            }
  +         }
  +      }
  +      else
  +      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, new Object[]{fqn});
         invokeMethod(m);
      }
  +   }
   
      /**
       * Removes <code>key</code> from the node's hashmap
  
  
  



More information about the jboss-cvs-commits mailing list