[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/collection ...

Manik Surtani msurtani at jboss.com
Thu Jan 4 00:35:42 EST 2007


  User: msurtani
  Date: 07/01/04 00:35:42

  Modified:    src-50/org/jboss/cache/pojo/collection  CachedSetImpl.java
  Log:
  Major changes around nodes, and the way they interact with the interceptor stack.
  Also removed redundant methods in NodeSPI and removed the need for casting to NodeSPI in most cases.
  
  Revision  Changes    Path
  1.17      +16 -3     JBossCache/src-50/org/jboss/cache/pojo/collection/CachedSetImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedSetImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/collection/CachedSetImpl.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- CachedSetImpl.java	3 Jan 2007 08:55:37 -0000	1.16
  +++ CachedSetImpl.java	4 Jan 2007 05:35:42 -0000	1.17
  @@ -10,6 +10,7 @@
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Node;
  +import org.jboss.cache.NodeSPI;
   import org.jboss.cache.pojo.annotation.Reentrant;
   import org.jboss.cache.pojo.impl.PojoCacheImpl;
   import org.jboss.cache.pojo.interceptors.dynamic.AbstractCollectionInterceptor;
  @@ -37,7 +38,7 @@
   @Reentrant
   public class CachedSetImpl extends AbstractSet
   {
  -//   protected static final Log log_=LogFactory.getLog(CachedSetImpl.class);
  +   //   protected static final Log log_=LogFactory.getLog(CachedSetImpl.class);
   
      private PojoCacheImpl pCache_;
      private CacheSPI cache_;
  @@ -78,8 +79,10 @@
               return true;
            }
            if (o.equals(o2))
  +         {
               return false;
         }
  +      }
         // should never reach here
         throw new CacheException();
      }
  @@ -103,10 +106,14 @@
            Object key = toLong(hashCode, i);
            Object o2 = getNoUnmask(key);
            if (o2 == null)
  +         {
               return false;
  +         }
            if (o.equals(o2))
  +         {
               return true;
         }
  +      }
         return false;
      }
   
  @@ -114,7 +121,9 @@
      {
         Node node = cache_.getRoot().getChild(getFqn());
         if (node == null)
  +      {
            return Collections.EMPTY_SET.iterator();
  +      }
         return new IteratorImpl(node);
      }
   
  @@ -130,7 +139,9 @@
            Object key = toLong(hashCode, i);
            Object o2 = getNoUnmask(key);
            if (o2 == null)
  +         {
               break;
  +         }
            if (removed)
            {
               // move o2 to old key
  @@ -198,7 +209,9 @@
      public boolean equals(Object o)
      {
         if (o == this)
  +      {
            return true;
  +      }
   
         try
         {
  @@ -216,14 +229,14 @@
   
      private class IteratorImpl implements Iterator
      {
  -      private Iterator<Node> iterator;
  +      private Iterator<NodeSPI> iterator;
   
         private Node node;
         private Object o;
   
         private IteratorImpl(Node node)
         {
  -         Collection<Node> children = node.getChildren();
  +         Collection<NodeSPI> children = ((NodeSPI) node).getChildrenDirect();
            iterator = children.iterator();
         }
   
  
  
  



More information about the jboss-cvs-commits mailing list