[jboss-cvs] JBossCache/src/org/jboss/cache ...
Brian Stansberry
brian.stansberry at jboss.com
Wed Nov 15 01:49:25 EST 2006
User: bstansberry
Date: 06/11/15 01:49:25
Modified: src/org/jboss/cache Node.java Cache.java
TreeCacheProxyImpl.java
Log:
Return the old value from put(key, value)
Revision Changes Path
1.49 +2 -1 JBossCache/src/org/jboss/cache/Node.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Node.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Node.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- Node.java 18 Oct 2006 11:59:16 -0000 1.48
+++ Node.java 15 Nov 2006 06:49:25 -0000 1.49
@@ -87,8 +87,9 @@
*
* @param k
* @param v
+ * @return Returns the old value contained under this key. Null if key doesn't exist.
*/
- void put(Object k, Object v);
+ Object put(Object k, Object v);
/**
* Puts a key and a value into the current node's data map if nothing exists under the key.
1.15 +2 -1 JBossCache/src/org/jboss/cache/Cache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Cache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Cache.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- Cache.java 13 Nov 2006 14:47:52 -0000 1.14
+++ Cache.java 15 Nov 2006 06:49:25 -0000 1.15
@@ -94,8 +94,9 @@
* @param fqn <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be accessed.
* @param key
* @param value
+ * @return Returns the old value contained under this key. Null if key doesn't exist.
*/
- void put(Fqn fqn, Object key, Object value);
+ Object put(Fqn fqn, Object key, Object value);
/**
* For use cases that have an external representation and storage of data objects, doing a put() in the cache
1.48 +7 -5 JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCacheProxyImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- TreeCacheProxyImpl.java 14 Nov 2006 14:17:11 -0000 1.47
+++ TreeCacheProxyImpl.java 15 Nov 2006 06:49:25 -0000 1.48
@@ -209,9 +209,9 @@
throw new UnsupportedOperationException("Not implemented in this release");
}
- public void put(Fqn fqn, Object key, Object value)
+ public Object put(Fqn fqn, Object key, Object value)
{
- treeCache.put(fqn, key, value);
+ return treeCache.put(fqn, key, value);
}
public void putForExternalRead(Fqn fqn, Object key, Object value)
@@ -389,17 +389,19 @@
return child == null ? null : new TreeCacheProxyImpl(treeCache, child);
}
- public void put(Object k, Object v)
+ public Object put(Object k, Object v)
{
+ Object result = null;
if (treeCache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
{
- currentNode.put(k, v);
+ result = currentNode.put(k, v);
treeCache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
}
else
{
- treeCache.put(currentNode.getFqn(), k, v);
+ result = treeCache.put(currentNode.getFqn(), k, v);
}
+ return result;
}
public void putIfNull(Object k, Object v)
More information about the jboss-cvs-commits
mailing list