Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-04-06 06:59:02 -0400
committerStephan Herrmann2010-04-06 06:59:02 -0400
commit45b3f30f193d4c7d10ffa9fb452ed21492b0d1b5 (patch)
tree4fe4da26d6fd59d8fd4c54598281bcfad613e7fa /othersrc/OTRE
parentb07fe7ee883d2328a3de49f23c3d17b37286c313 (diff)
downloadorg.eclipse.objectteams-45b3f30f193d4c7d10ffa9fb452ed21492b0d1b5.tar.gz
org.eclipse.objectteams-45b3f30f193d4c7d10ffa9fb452ed21492b0d1b5.tar.xz
org.eclipse.objectteams-45b3f30f193d4c7d10ffa9fb452ed21492b0d1b5.zip
proposed patch for bug 308181.
Diffstat (limited to 'othersrc/OTRE')
-rw-r--r--othersrc/OTRE/src/org/objectteams/DoublyWeakHashMap.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/othersrc/OTRE/src/org/objectteams/DoublyWeakHashMap.java b/othersrc/OTRE/src/org/objectteams/DoublyWeakHashMap.java
index bbf4ef8e6..05a2f91fa 100644
--- a/othersrc/OTRE/src/org/objectteams/DoublyWeakHashMap.java
+++ b/othersrc/OTRE/src/org/objectteams/DoublyWeakHashMap.java
@@ -65,13 +65,13 @@ public class DoublyWeakHashMap<K,V> implements Map<K,V> {
}
// used from migrateToBase() and lifting constructor
- public V put(K key, V value) {
+ public synchronized V put(K key, V value) {
this.map.put(key, new WeakReference<V>(value));
return value;
}
// used from unregisterRole(), migrateToBase()
- public V remove(Object key) {
+ public synchronized V remove(Object key) {
WeakReference<V> value = this.map.remove(key);
return (value == null) ? null : value.get();
}
@@ -90,7 +90,7 @@ public class DoublyWeakHashMap<K,V> implements Map<K,V> {
}
// used from getAllRoles() et al.
- public Collection<V> values() {
+ public synchronized Collection<V> values() {
ArrayList<V> result = new ArrayList<V>(this.map.size());
for (WeakReference<V> valRef : this.map.values()) {
V value = valRef.get();

Back to the top