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")

View File

@@ -52,7 +52,7 @@ public class SelectionTrackingActionListener implements ActionListener {
private final ActionListener delegate;
private final Map<Class<?>, Method> valueMethodCache = new ConcurrentHashMap<Class<?>, Method>(256);
private final Map<Class<?>, Method> valueMethodCache = new ConcurrentHashMap<>(256);
public SelectionTrackingActionListener(ActionListener delegate) {

View File

@@ -58,7 +58,7 @@ public class TransitionExecutingFlowExecutionExceptionHandler implements FlowExe
/**
* The exceptionType to targetStateResolver map.
*/
private Map<Class<? extends Throwable>, TargetStateResolver> exceptionTargetStateMappings = new HashMap<Class<? extends Throwable>, TargetStateResolver>();
private Map<Class<? extends Throwable>, TargetStateResolver> exceptionTargetStateMappings = new HashMap<>();
/**
* The list of actions to execute when this handler handles an exception.
@@ -190,4 +190,4 @@ public class TransitionExecutingFlowExecutionExceptionHandler implements FlowExe
public String toString() {
return new ToStringCreator(this).append("exceptionHandlingMappings", exceptionTargetStateMappings).toString();
}
}
}

View File

@@ -231,7 +231,7 @@ public class SerializedFlowExecutionSnapshot extends FlowExecutionSnapshot imple
private static class ConfigurableObjectInputStream extends ObjectInputStream {
/* Temporary workaround for SPR-???? */
private static final HashMap<String, Class<?>> PRIMITIVE_CLASSES = new HashMap<String, Class<?>>(8, 1.0F);
private static final HashMap<String, Class<?>> PRIMITIVE_CLASSES = new HashMap<>(8, 1.0F);
static {
PRIMITIVE_CLASSES.put("boolean", boolean.class);
PRIMITIVE_CLASSES.put("byte", byte.class);

View File

@@ -107,7 +107,7 @@ public class SecurityFlowExecutionListener implements FlowExecutionListener {
}
private AbstractAccessDecisionManager createManager(SecurityRule rule) {
List<AccessDecisionVoter<? extends Object>> voters = new ArrayList<AccessDecisionVoter<? extends Object>>();
List<AccessDecisionVoter<? extends Object>> voters = new ArrayList<>();
voters.add(new RoleVoter());
if (rule.getComparisonType() == SecurityRule.COMPARISON_ANY) {
return new AffirmativeBased(voters);

View File

@@ -357,7 +357,7 @@ public class ValidationHelper {
private Method findValidationMethod(Object model, Object validator, String methodName, Class<?> context) {
Class<?> modelClass = AopUtils.getTargetClass(model);
List<Class<?>> modelSearchClasses = new ArrayList<Class<?>>();
List<Class<?>> modelSearchClasses = new ArrayList<>();
while (modelClass != null) {
modelSearchClasses.add(modelClass);
modelClass = modelClass.getSuperclass();