parent
13dc0cd828
commit
1b9e12f52f
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -268,7 +268,7 @@ public abstract class BeanFactoryUtils {
|
|||
String beanName = entry.getKey();
|
||||
if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) {
|
||||
result.put(beanName, entry.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,10 +106,10 @@ public abstract class ClassUtils {
|
|||
primitiveWrapperTypeMap.put(Integer.class, int.class);
|
||||
primitiveWrapperTypeMap.put(Long.class, long.class);
|
||||
primitiveWrapperTypeMap.put(Short.class, short.class);
|
||||
|
||||
primitiveWrapperTypeMap.entrySet().forEach(entry -> {
|
||||
primitiveTypeToWrapperMap.put(entry.getValue(), entry.getKey());
|
||||
registerCommonClasses(entry.getKey());
|
||||
|
||||
primitiveWrapperTypeMap.forEach((key, value) -> {
|
||||
primitiveTypeToWrapperMap.put(value, key);
|
||||
registerCommonClasses(key);
|
||||
});
|
||||
|
||||
Set<Class<?>> primitiveTypes = new HashSet<>(32);
|
||||
|
|
|
@ -354,9 +354,9 @@ public abstract class CollectionUtils {
|
|||
public static <K, V> MultiValueMap<K, V> unmodifiableMultiValueMap(MultiValueMap<? extends K, ? extends V> map) {
|
||||
Assert.notNull(map, "'map' must not be null");
|
||||
Map<K, List<V>> result = new LinkedHashMap<>(map.size());
|
||||
map.entrySet().forEach(entry -> {
|
||||
List<? extends V> values = Collections.unmodifiableList(entry.getValue());
|
||||
result.put(entry.getKey(), (List<V>) values);
|
||||
map.forEach((key, value) -> {
|
||||
List<? extends V> values = Collections.unmodifiableList(value);
|
||||
result.put(key, (List<V>) values);
|
||||
});
|
||||
Map<K, List<V>> unmodifiableMap = Collections.unmodifiableMap(result);
|
||||
return toMultiValueMap(unmodifiableMap);
|
||||
|
@ -431,13 +431,13 @@ public abstract class CollectionUtils {
|
|||
|
||||
@Override
|
||||
public void setAll(Map<K, V> values) {
|
||||
values.entrySet().forEach(entry -> set(entry.getKey(), entry.getValue()));
|
||||
values.forEach(this::set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<K, V> toSingleValueMap() {
|
||||
LinkedHashMap<K, V> singleValueMap = new LinkedHashMap<>(this.map.size());
|
||||
map.entrySet().forEach(entry -> singleValueMap.put(entry.getKey(), entry.getValue().get(0)));
|
||||
this.map.forEach((key, value) -> singleValueMap.put(key, value.get(0)));
|
||||
return singleValueMap;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,8 +169,7 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
|||
if (map.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
map.entrySet().forEach(entry -> put(entry.getKey(), entry.getValue()));
|
||||
|
||||
map.forEach(this::put);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -100,14 +100,13 @@ public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializa
|
|||
|
||||
@Override
|
||||
public void setAll(Map<K, V> values) {
|
||||
values.entrySet().forEach(entry -> set(entry.getKey(), entry.getValue()));
|
||||
values.forEach(this::set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<K, V> toSingleValueMap() {
|
||||
LinkedHashMap<K, V> singleValueMap = new LinkedHashMap<>(this.targetMap.size());
|
||||
this.targetMap.entrySet().forEach(entry ->
|
||||
singleValueMap.put(entry.getKey(), entry.getValue().get(0)));
|
||||
this.targetMap.forEach((key, value) -> singleValueMap.put(key, value.get(0)));
|
||||
|
||||
return singleValueMap;
|
||||
}
|
||||
|
|
|
@ -192,10 +192,8 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
|||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(methods.size() + " request handler methods found on " + userType + ": " + methods);
|
||||
}
|
||||
|
||||
methods.entrySet().forEach(entry -> {
|
||||
Method invocableMethod = AopUtils.selectInvocableMethod(entry.getKey(), userType);
|
||||
T mapping = entry.getValue();
|
||||
methods.forEach((key, mapping) -> {
|
||||
Method invocableMethod = AopUtils.selectInvocableMethod(key, userType);
|
||||
registerHandlerMethod(handler, invocableMethod, mapping);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -114,9 +114,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
|
|||
logger.warn("Neither 'urlMap' nor 'mappings' set on SimpleUrlHandlerMapping");
|
||||
}
|
||||
else {
|
||||
urlMap.entrySet().forEach(entry -> {
|
||||
String url = entry.getKey();
|
||||
Object handler = entry.getValue();
|
||||
urlMap.forEach((url, handler) -> {
|
||||
// Prepend with slash if not already present.
|
||||
if (!url.startsWith("/")) {
|
||||
url = "/" + url;
|
||||
|
|
Loading…
Reference in New Issue