Polish "Refactor iterator of Map with Java8's Map.forEach"
Closes gh-1459
This commit is contained in:
parent
1ef5f61ab2
commit
1ab678a2a3
|
@ -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.
|
||||
|
@ -19,6 +19,7 @@ package org.springframework.cache.caffeine;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
|
@ -222,7 +223,9 @@ public class CaffeineCacheManager implements CacheManager {
|
|||
* Create the known caches again with the current state of this manager.
|
||||
*/
|
||||
private void refreshKnownCaches() {
|
||||
this.cacheMap.forEach((key, value) -> createCaffeineCache(key));
|
||||
for (Map.Entry<String, Cache> entry : this.cacheMap.entrySet()) {
|
||||
entry.setValue(createCaffeineCache(entry.getKey()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -226,7 +226,8 @@ public class JmsListenerAnnotationBeanPostProcessor
|
|||
else {
|
||||
// Non-empty set of methods
|
||||
annotatedMethods.forEach((method, listeners) ->
|
||||
listeners.forEach(listener -> processJmsListener(listener, method, bean)));
|
||||
listeners.forEach(listener ->
|
||||
processJmsListener(listener, method, bean)));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(annotatedMethods.size() + " @JmsListener methods processed on bean '" + beanName +
|
||||
"': " + annotatedMethods);
|
||||
|
|
|
@ -197,7 +197,8 @@ public class NativeMessageHeaderAccessor extends MessageHeaderAccessor {
|
|||
if (headers == null) {
|
||||
return;
|
||||
}
|
||||
headers.forEach((key, values) -> values.forEach(value -> addNativeHeader(key, value)));
|
||||
headers.forEach((key, values) ->
|
||||
values.forEach(value -> addNativeHeader(key, value)));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2014 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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue