From a8d4cbda7f25ba191d8113bf7d090fea2705911e Mon Sep 17 00:00:00 2001 From: Oleh Dokuka <5380167+OlegDokuka@users.noreply.github.com> Date: Wed, 30 Nov 2022 18:23:40 +0200 Subject: [PATCH] removes NotNull annotation from jetbrains (#3303) Signed-off-by: Oleh Dokuka Signed-off-by: OlegDokuka Signed-off-by: Oleh Dokuka Signed-off-by: OlegDokuka --- .../core/publisher/FluxFlattenIterableTest.java | 11 +++-------- .../java/reactor/core/publisher/FluxIterableTest.java | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java b/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java index e0d745756b..6ddd231027 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java @@ -29,7 +29,6 @@ import java.util.stream.IntStream; import org.assertj.core.api.Assertions; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.reactivestreams.Subscription; import reactor.core.CoreSubscriber; @@ -148,13 +147,9 @@ public void useIterableOncePerSubscriber() { AtomicInteger calls = new AtomicInteger(); Flux.range(1, 5) - .concatMapIterable(v -> new Iterable() { - @NotNull - @Override - public Iterator iterator() { - calls.incrementAndGet(); - return Arrays.asList("hello " + v).iterator(); - } + .concatMapIterable(v -> (Iterable) () -> { + calls.incrementAndGet(); + return Arrays.asList("hello " + v).iterator(); }) .as(StepVerifier::create) .expectNext("hello 1", "hello 2", "hello 3", "hello 4", "hello 5") diff --git a/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java b/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java index 38cd4fbd64..412d0b5e87 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java @@ -25,7 +25,6 @@ import org.assertj.core.api.Assertions; import org.assertj.core.api.InstanceOfAssertFactories; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.mockito.Mockito; @@ -54,13 +53,9 @@ public class FluxIterableTest { //https://github.com/reactor/reactor-core/issues/3295 public void useIterableOncePerSubscriber() { AtomicInteger calls = new AtomicInteger(); - Iterable strings = new Iterable() { - @NotNull - @Override - public Iterator iterator() { - calls.incrementAndGet(); - return Arrays.asList("hello").iterator(); - } + Iterable strings = () -> { + calls.incrementAndGet(); + return Arrays.asList("hello").iterator(); }; StepVerifier.create(Flux.fromIterable(strings)) .expectNext("hello")