Use abbreviated expression lambda instead of statement lambda

Closes gh-1126
master
Kamil Szymanski 8 years ago committed by Stephane Nicoll
parent 0a5e5776c1
commit 4aea551e8e
  1. 6
      spring-web/src/main/java/org/springframework/http/server/reactive/RxNettyServerHttpResponse.java

@ -82,11 +82,9 @@ public class RxNettyServerHttpResponse extends AbstractServerHttpResponse {
protected Mono<Void> writeAndFlushWithInternal( protected Mono<Void> writeAndFlushWithInternal(
Publisher<Publisher<DataBuffer>> body) { Publisher<Publisher<DataBuffer>> body) {
Flux<ByteBuf> bodyWithFlushSignals = Flux.from(body). Flux<ByteBuf> bodyWithFlushSignals = Flux.from(body).
flatMap(publisher -> { flatMap(publisher -> Flux.from(publisher).
return Flux.from(publisher).
map(NettyDataBufferFactory::toByteBuf). map(NettyDataBufferFactory::toByteBuf).
concatWith(Mono.just(FLUSH_SIGNAL)); concatWith(Mono.just(FLUSH_SIGNAL)));
});
Observable<ByteBuf> content = RxJava1Adapter.publisherToObservable(bodyWithFlushSignals); Observable<ByteBuf> content = RxJava1Adapter.publisherToObservable(bodyWithFlushSignals);
ResponseContentWriter<ByteBuf> writer = this.response.write(content, bb -> bb == FLUSH_SIGNAL); ResponseContentWriter<ByteBuf> writer = this.response.write(content, bb -> bb == FLUSH_SIGNAL);
return RxJava1Adapter.observableToFlux(writer).then(); return RxJava1Adapter.observableToFlux(writer).then();

Loading…
Cancel
Save