Use Map#forEach instead of Map#entrySet#forEach

See gh-1449
This commit is contained in:
diguage
2017-06-05 16:39:28 +08:00
committed by Stephane Nicoll
parent 424bc75fb1
commit 2efa06237a
10 changed files with 38 additions and 39 deletions

View File

@@ -175,10 +175,11 @@ class DefaultClientRequestBuilder implements ClientRequest.Builder {
MultiValueMap<String, HttpCookie> requestCookies = request.getCookies();
if (!this.cookies.isEmpty()) {
this.cookies.forEach((name, values) -> values.forEach(value -> {
HttpCookie cookie = new HttpCookie(name, value);
requestCookies.add(name, cookie);
}));
this.cookies.forEach(( name , values) ->
values.forEach(value -> {
HttpCookie cookie = new HttpCookie(name, value);
requestCookies.add(name, cookie);
}));
}
return this.inserter.insert(request, new BodyInserter.Context() {

View File

@@ -224,10 +224,10 @@ class ControllerMethodResolver {
Class<?> handlerType = handlerMethod.getBeanType();
// Global methods first
this.initBinderAdviceCache.entrySet().forEach(entry -> {
if (entry.getKey().isApplicableToBeanType(handlerType)) {
Object bean = entry.getKey().resolveBean();
entry.getValue().forEach(method -> result.add(getInitBinderMethod(bean, method)));
this.initBinderAdviceCache.forEach((adviceBean, methods) -> {
if (adviceBean.isApplicableToBeanType(handlerType)) {
Object bean = adviceBean.resolveBean();
methods.forEach(method -> result.add(getInitBinderMethod(bean, method)));
}
});
@@ -257,10 +257,10 @@ class ControllerMethodResolver {
Class<?> handlerType = handlerMethod.getBeanType();
// Global methods first
this.modelAttributeAdviceCache.entrySet().forEach(entry -> {
if (entry.getKey().isApplicableToBeanType(handlerType)) {
Object bean = entry.getKey().resolveBean();
entry.getValue().forEach(method -> result.add(createAttributeMethod(bean, method)));
this.modelAttributeAdviceCache.forEach((adviceBean, methods) -> {
if (adviceBean.isApplicableToBeanType(handlerType)) {
Object bean = adviceBean.resolveBean();
methods.forEach(method -> result.add(createAttributeMethod(bean, method)));
}
});

View File

@@ -93,7 +93,7 @@ public class ReactorNettyWebSocketClient extends WebSocketClientSupport implemen
}
private void setNettyHeaders(HttpHeaders headers, io.netty.handler.codec.http.HttpHeaders nettyHeaders) {
headers.keySet().stream().forEach(key -> nettyHeaders.set(key, headers.get(key)));
headers.forEach(nettyHeaders::set);
}
private HttpHeaders toHttpHeaders(HttpClientResponse response) {