import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
return Logger.getLogger(DesignAttributeHandler.class.getName());
}
- private static Map<Class<?>, AttributeCacheEntry> cache = Collections
- .synchronizedMap(new HashMap<Class<?>, AttributeCacheEntry>());
+ private static Map<Class<?>, AttributeCacheEntry> cache = new ConcurrentHashMap<Class<?>, AttributeCacheEntry>();
// translates string <-> object
private static DesignFormatter FORMATTER = new DesignFormatter();
* @author Vaadin Ltd
*/
private static class AttributeCacheEntry implements Serializable {
- private Map<String, Method[]> accessMethods = Collections
- .synchronizedMap(new HashMap<String, Method[]>());
+ private Map<String, Method[]> accessMethods = new ConcurrentHashMap<String, Method[]>();
private void addAttribute(String attribute, Method getter, Method setter) {
Method[] methods = new Method[2];
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Document;
public class DesignContext implements Serializable {
// cache for object instances
- private static Map<Class<?>, Component> instanceCache = Collections
- .synchronizedMap(new HashMap<Class<?>, Component>());
+ private static Map<Class<?>, Component> instanceCache = new ConcurrentHashMap<Class<?>, Component>();
// The root component of the component hierarchy
private Component rootComponent = null;
import java.text.DecimalFormatSymbols;
import java.util.Collections;
import java.util.Date;
-import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
+import java.util.concurrent.ConcurrentHashMap;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.declarative.converters.DesignFormatConverter;
import com.vaadin.ui.declarative.converters.DesignResourceConverter;
import com.vaadin.ui.declarative.converters.DesignShortcutActionConverter;
-import com.vaadin.ui.declarative.converters.ShortcutKeyMapper;
import com.vaadin.ui.declarative.converters.DesignToStringConverter;
+import com.vaadin.ui.declarative.converters.ShortcutKeyMapper;
/**
* Class focused on flexible and consistent formatting and parsing of different
*/
public class DesignFormatter implements Serializable {
- private final Map<Class<?>, Converter<String, ?>> converterMap = Collections
- .synchronizedMap(new HashMap<Class<?>, Converter<String, ?>>());
+ private final Map<Class<?>, Converter<String, ?>> converterMap = new ConcurrentHashMap<Class<?>, Converter<String, ?>>();
/**
* Creates the formatter with default types already mapped.
package com.vaadin.ui.declarative.converters;
import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
*/
public static final ShortcutKeyMapper DEFAULT = new ShortcutKeyMapper() {
- private final Map<Integer, String> keyCodeMap = Collections
- .synchronizedMap(new HashMap<Integer, String>());
- private final Map<String, Integer> presentationMap = Collections
- .synchronizedMap(new HashMap<String, Integer>());
+ private final Map<Integer, String> keyCodeMap = new ConcurrentHashMap<Integer, String>();
+ private final Map<String, Integer> presentationMap = new ConcurrentHashMap<String, Integer>();
{
// map modifiers