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

This commit is contained in:
igor-suhorukov
2018-03-08 23:45:35 +03:00
committed by Juergen Hoeller
parent 6163f2d32f
commit 0c45c4c6a3
3 changed files with 6 additions and 9 deletions

View File

@@ -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) {

View File

@@ -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);
}
});
});
}));
}

View File

@@ -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);
}
});
});
}));
});
}