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

Brian Stansberry brian.stansberry at jboss.com
Mon Sep 18 16:48:44 EDT 2006


  User: bstansberry
  Date: 06/09/18 16:48:44

  Modified:    src/org/jboss/cache/loader   AbstractCacheLoader.java
                        AsyncCacheLoader.java
  Log:
  [JBCACHE-769] Make a defensive copy of map passed to put(Fqn, Map)
  
  Revision  Changes    Path
  1.5       +5 -1      JBossCache/src/org/jboss/cache/loader/AbstractCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AbstractCacheLoader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- AbstractCacheLoader.java	16 Sep 2006 00:23:35 -0000	1.4
  +++ AbstractCacheLoader.java	18 Sep 2006 20:48:44 -0000	1.5
  @@ -15,6 +15,7 @@
   
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
  +import java.util.HashMap;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  @@ -36,7 +37,10 @@
         {
            removeData(fqn);
         }
  -      put(fqn, attributes);
  +      
  +      // JBCACHE-769 -- make a defensive copy
  +      Map attrs = (attributes == null ? null : new HashMap(attributes));
  +      put(fqn, attrs);
      }
   
      public void storeEntireState(ObjectInputStream is) throws Exception
  
  
  
  1.17      +5 -3      JBossCache/src/org/jboss/cache/loader/AsyncCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsyncCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AsyncCacheLoader.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- AsyncCacheLoader.java	31 Aug 2006 21:34:54 -0000	1.16
  +++ AsyncCacheLoader.java	18 Sep 2006 20:48:44 -0000	1.17
  @@ -214,10 +214,12 @@
      {
         if (asyncPut)
         {
  -         Modification mod = new Modification(Modification.PUT_DATA, name, attributes);
  +         // JBCACHE-769 -- make a defensive copy
  +         Map attrs = (attributes == null ? null : new HashMap(attributes));
  +         Modification mod = new Modification(Modification.PUT_DATA, name, attrs);
            enqueue(mod);
         } 
  -      else delegateTo.put(name, attributes);
  +      else delegateTo.put(name, attributes); // Let delegate make its own defensive copy
      }
   
       public void put(List<Modification> modifications) throws Exception
  
  
  



More information about the jboss-cvs-commits mailing list