Author: david.lloyd(a)jboss.com
Date: 2009-11-02 17:05:58 -0500 (Mon, 02 Nov 2009)
New Revision: 5576
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/CopyOnWriteHashMap.java
Log:
Fix broken copy-on-write-ness
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/CopyOnWriteHashMap.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/CopyOnWriteHashMap.java 2009-10-31
03:22:09 UTC (rev 5575)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/CopyOnWriteHashMap.java 2009-11-02
22:05:58 UTC (rev 5576)
@@ -67,7 +67,7 @@
this.map = singletonMap(key, value);
} else {
final Map<K, V> copy = copy(map);
- map.put(key, value);
+ copy.put(key, value);
this.map = copy;
}
return null;
@@ -86,7 +86,7 @@
this.map = emptyMap();
} else {
final Map<K, V> copy = copy(map);
- map.remove(key);
+ copy.remove(key);
this.map = copy;
}
return true;
@@ -108,7 +108,7 @@
this.map = singletonMap(key, newValue);
} else {
final Map<K, V> copy = copy(map);
- map.put(key, newValue);
+ copy.put(key, newValue);
this.map = copy;
}
return true;
@@ -130,7 +130,7 @@
this.map = singletonMap(key, value);
} else {
final Map<K, V> copy = copy(map);
- map.put(key, value);
+ copy.put(key, value);
this.map = copy;
}
}
@@ -172,7 +172,7 @@
this.map = singletonMap(key, value);
} else {
final Map<K, V> copy = copy(map);
- map.put(key, value);
+ copy.put(key, value);
this.map = copy;
}
return old;
@@ -189,7 +189,7 @@
this.map = emptyMap();
} else {
final Map<K, V> copy = copy(map);
- map.remove(key);
+ copy.remove(key);
this.map = copy;
}
}