提交 0c45c4c6 编写于 作者: I igor-suhorukov 提交者: Juergen Hoeller

lamdbas containing only one statement should not nest this statement in a block

上级 6163f2d3
......@@ -363,9 +363,8 @@ public abstract class DataBufferUtils {
Assert.isTrue(position >= 0, "'position' must be >= 0");
Flux<DataBuffer> flux = Flux.from(source);
return Flux.create(sink -> {
flux.subscribe(new AsynchronousFileChannelWriteCompletionHandler(sink, channel, position));
});
return Flux.create(sink ->
flux.subscribe(new AsynchronousFileChannelWriteCompletionHandler(sink, channel, position)));
}
private static void closeChannel(@Nullable Channel channel) {
......
......@@ -100,7 +100,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
List<SimpleUrlHandlerMapping> mappings = new ArrayList<>(beans.values());
AnnotationAwareOrderComparator.sort(mappings);
mappings.forEach(mapping -> {
mappings.forEach(mapping ->
mapping.getHandlerMap().forEach((pattern, handler) -> {
if (handler instanceof ResourceWebHandler) {
ResourceWebHandler resourceHandler = (ResourceWebHandler) handler;
......@@ -111,8 +111,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
}
this.handlerMap.put(pattern, resourceHandler);
}
});
});
}));
}
......
......@@ -92,14 +92,13 @@ class ModelInitializer {
bindingContext.getModel().mergeAttributes(attributes);
bindingContext.setSessionContext(sessionAttributesHandler, session);
return invokeModelAttributeMethods(bindingContext, modelMethods, exchange)
.doOnSuccess(aVoid -> {
.doOnSuccess(aVoid ->
findModelAttributes(handlerMethod, sessionAttributesHandler).forEach(name -> {
if (!bindingContext.getModel().containsAttribute(name)) {
Object value = session.getRequiredAttribute(name);
bindingContext.getModel().addAttribute(name, value);
}
});
});
}));
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册