[jboss-cvs] JBossCache/src/org/jboss/cache/loader ...
Brian Stansberry
brian.stansberry at jboss.com
Thu Sep 14 23:28:39 EDT 2006
User: bstansberry
Date: 06/09/14 23:28:39
Modified: src/org/jboss/cache/loader JDBCCacheLoader.java
Log:
[JBCACHE-769] Make a defensive copy before persisting a passed-in Map
Revision Changes Path
1.15 +9 -6 JBossCache/src/org/jboss/cache/loader/JDBCCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JDBCCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/JDBCCacheLoader.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- JDBCCacheLoader.java 12 Sep 2006 20:16:55 -0000 1.14
+++ JDBCCacheLoader.java 15 Sep 2006 03:28:39 -0000 1.15
@@ -75,7 +75,7 @@
*
* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
* @author <a href="mailto:hmesha at novell.com">Hany Mesha </a>
- * @version <tt>$Revision: 1.14 $</tt>
+ * @version <tt>$Revision: 1.15 $</tt>
*/
public class JDBCCacheLoader extends AbstractCacheLoader
{
@@ -718,14 +718,17 @@
public void put(Fqn name, Map attributes, boolean override) throws Exception
{
+ // JBCACHE-769 -- make a defensive copy
+ Map attrs = (attributes == null ? null : new HashMap(attributes));
+
Map oldNode = loadNode(name);
if(oldNode != null)
{
- if(!override && oldNode != NULL_NODE_IN_ROW && attributes != null)
+ if(!override && oldNode != NULL_NODE_IN_ROW && attrs != null)
{
- attributes.putAll(oldNode);
+ attrs.putAll(oldNode);
}
- updateNode(name, attributes);
+ updateNode(name, attrs);
}
else
{
@@ -740,7 +743,7 @@
}
}
}
- insertNode(name, attributes);
+ insertNode(name, attrs);
}
}
More information about the jboss-cvs-commits
mailing list