lamdbas containing only one statement should not nest this statement in a block
This commit is contained in:
committed by
Juergen Hoeller
parent
6163f2d32f
commit
0c45c4c6a3
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user