From 96b3faad967bc147ca523d963a0a206262c2f2c6 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 5 May 2018 14:40:37 +0200 Subject: [PATCH] Remove unnecessary null filtering --- .../com/example/webfluxdemo/controller/PersonController.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/example/webfluxdemo/controller/PersonController.java b/src/main/java/com/example/webfluxdemo/controller/PersonController.java index 05e42f8..5d0f99e 100644 --- a/src/main/java/com/example/webfluxdemo/controller/PersonController.java +++ b/src/main/java/com/example/webfluxdemo/controller/PersonController.java @@ -15,7 +15,6 @@ import reactor.core.publisher.Mono; import java.time.Duration; -import java.util.Objects; import java.util.Set; @RestController @@ -44,7 +43,6 @@ public Flux getPersonsByStringNumber(@RequestParam Set numbers) { return Flux.fromIterable(numbers) .flatMap(number -> reactiveRedisTemplate.opsForValue().get(number).doOnNext(log::info)) - .filter(Objects::nonNull) .map(Integer::valueOf) .flatMap(id -> mongoRepository.findById(id).doOnNext(person -> log.info(person.toString()))) .switchIfEmpty(Mono.error(new IllegalArgumentException("Not found person.")));