Java 7: Explicit type can be replaced with <>

This commit is contained in:
Lars Grefer
2019-08-27 02:10:07 +02:00
committed by Rossen Stoyanchev
parent ab69df656d
commit 55137e101a
8 changed files with 10 additions and 10 deletions

View File

@@ -68,7 +68,7 @@ public abstract class AbstractCachingMapDecorator<K, V> implements Map<K, V>, Se
* @param size the initial cache size
*/
public AbstractCachingMapDecorator(boolean weak, int size) {
Map<K, Object> internalMap = weak ? new WeakHashMap<K, Object> (size) : new HashMap<>(size);
Map<K, Object> internalMap = weak ? new WeakHashMap<>(size) : new HashMap<>(size);
this.targetMap = Collections.synchronizedMap(internalMap);
this.synchronize = true;
this.weak = weak;

View File

@@ -46,7 +46,7 @@ public class ELExpressionParser implements ExpressionParser {
private ExpressionFactory expressionFactory;
private Map<Class<?>, ELContextFactory> contextFactories = new HashMap<Class<?>, ELContextFactory>();
private Map<Class<?>, ELContextFactory> contextFactories = new HashMap<>();
private ConversionService conversionService = new DefaultConversionService();

View File

@@ -45,7 +45,7 @@ public class DefaultMessageContext implements StateManageableMessageContext {
@SuppressWarnings("serial")
private Map<Object, List<Message>> sourceMessages = new AbstractCachingMapDecorator<Object, List<Message>>(
new LinkedHashMap<Object, List<Message>>()) {
new LinkedHashMap<>()) {
protected List<Message> create(Object source) {
return new ArrayList<>();
@@ -130,7 +130,7 @@ public class DefaultMessageContext implements StateManageableMessageContext {
// implementing state manageable message context
public Serializable createMessagesMemento() {
return new LinkedHashMap<Object, List<Message>>(sourceMessages);
return new LinkedHashMap<>(sourceMessages);
}
@SuppressWarnings("unchecked")