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

Elias Ross genman at noderunner.net
Mon Nov 20 03:51:50 EST 2006


  User: genman  
  Date: 06/11/20 03:51:50

  Modified:    src/org/jboss/cache  TreeCache.java
  Log:
  JBCACHE-867 - Fix emptyMap versus null in notify; use correct Node.put()
  
  Revision  Changes    Path
  1.282     +9 -8      JBossCache/src/org/jboss/cache/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/TreeCache.java,v
  retrieving revision 1.281
  retrieving revision 1.282
  diff -u -b -r1.281 -r1.282
  --- TreeCache.java	20 Nov 2006 07:33:13 -0000	1.281
  +++ TreeCache.java	20 Nov 2006 08:51:49 -0000	1.282
  @@ -96,7 +96,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.281 2006/11/20 07:33:13 genman Exp $
  + * @version $Id: TreeCache.java,v 1.282 2006/11/20 08:51:49 genman Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -2259,7 +2259,7 @@
                  false, true);
         }
   
  -      n.put(data, erase_contents);
  +      ((DataNode)n).put(data, (boolean)erase_contents);
   
         if (undo_op != null)
         {
  @@ -2311,7 +2311,8 @@
            throw new NodeNotExistsException(errStr);
         }
   
  -      notifier.notifyNodeModified(fqn, true, n.getNodeSPI().getRawData());
  +      Map rawData = n.getNodeSPI().getRawData();
  +      notifier.notifyNodeModified(fqn, true, rawData);
         getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
         old_value = n.put(key, value);
         getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  @@ -2332,7 +2333,7 @@
            tx_table.addUndoOperation(tx, undo_op);
         }
   
  -      notifier.notifyNodeModified(fqn, false, n.getData() == null ? Collections.emptyMap() : Collections.unmodifiableMap(n.getData()));
  +      notifier.notifyNodeModified(fqn, false, rawData);
         return old_value;
      }
   
  @@ -2628,7 +2629,7 @@
            }
            else
            {
  -            notifier.notifyNodeModified(fqn, false, n.getData() == null ? Collections.emptyMap() : Collections.unmodifiableMap(n.getData()));
  +            notifier.notifyNodeModified(fqn, false, n.getData());
            }
         }
   
  @@ -3766,18 +3767,18 @@
      {
         Node n, child_node = null;
         Object child_name;
  -      int treeNodeSize;
   
         if (fqn == null) return null;
         DataNode toReturn = null;
  -      if ((treeNodeSize = fqn.size()) == 0)
  +      if (fqn.isRoot())
         {
            toReturn = root;
         }
         else
         {
            n = root;
  -         for (int i = 0; i < treeNodeSize; i++)
  +         int size = fqn.size();
  +         for (int i = 0; i < size; i++)
            {
               child_name = fqn.get(i);
               child_node = n.getNodeSPI().getChildrenMap().get(child_name);
  
  
  



More information about the jboss-cvs-commits mailing list