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