Skip to content
Snippets Groups Projects
Commit e0a12aee authored by srosse's avatar srosse
Browse files

OO-948: remove the synchronized in i18nManager, rely on ConcurrentHashMap for it

parent f906df89
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
/**
* <h3>Description:</h3>
......@@ -34,54 +35,85 @@ import java.util.Set;
*
* @author Florian Gnaegi, frentix GmbH, http://www.frentix.com
*/
public class AlwaysEmptyMap<K, V> implements Map<K, V> {
public class AlwaysEmptyMap<K, V> implements ConcurrentMap<K, V> {
@Override
public void clear() {
// nothing to do
}
public boolean containsKey(@SuppressWarnings("unused") Object key) {
@Override
public boolean containsKey(Object key) {
return false;
}
public boolean containsValue(@SuppressWarnings("unused") Object value) {
@Override
public boolean containsValue(Object value) {
return false;
}
@Override
public Set<java.util.Map.Entry<K, V>> entrySet() {
return new HashSet<java.util.Map.Entry<K, V>>();
}
public V get(@SuppressWarnings("unused") Object key) {
@Override
public V get(Object key) {
return null;
}
@Override
public boolean isEmpty() {
return true;
}
@Override
public Set<K> keySet() {
return new HashSet<K>();
}
public V put(@SuppressWarnings("unused") K key, @SuppressWarnings("unused") V value) {
@Override
public V put(K key, V value) {
return null;
}
public void putAll(@SuppressWarnings("unused") Map<? extends K, ? extends V> t) {
@Override
public void putAll(Map<? extends K, ? extends V> t) {
// nothing to do
}
public V remove(@SuppressWarnings("unused") Object key) {
@Override
public V remove(Object key) {
return null;
}
@Override
public int size() {
return 0;
}
@Override
public Collection<V> values() {
return new HashSet<V>();
}
@Override
public V putIfAbsent(K key, V value) {
return null;
}
@Override
public boolean remove(Object key, Object value) {
return false;
}
@Override
public boolean replace(K key, V oldValue, V newValue) {
return false;
}
@Override
public V replace(K key, V value) {
return null;
}
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment