ReactorRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

Disable all rules by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$).* as compiler argument.

Table of contents
  1. MonoFromSupplier
  2. MonoEmpty
  3. MonoTimeoutMonoEmptyDuration
  4. MonoTimeoutMonoJustDuration
  5. MonoTimeoutDuration
  6. MonoTimeoutMonoEmptyPublisher
  7. MonoTimeoutMonoJustPublisher
  8. MonoTimeoutPublisher
  9. MonoJust
  10. MonoJustOrEmptyObject
  11. MonoJustOrEmptyOptional
  12. MonoDeferMonoJustOrEmpty
  13. OptionalMapMonoJust
  14. MonoJustOrEmptySwitchIfEmpty
  15. MonoZip
  16. MonoZipMapFunction
  17. FluxZip
  18. FluxZipMapFunction
  19. FluxZipWithIterable
  20. FluxZipWithIterableWithBiFunction
  21. FluxZipWithIterableMapFunction
  22. MonoErrorThrowable
  23. FluxErrorThrowable
  24. MonoErrorSupplier
  25. FluxErrorSupplier
  26. MonoThenReturn
  27. FluxTake
  28. MonoDefaultIfEmpty
  29. FluxDefaultIfEmpty
  30. FluxEmpty
  31. FluxTimeoutFluxEmpty
  32. FluxJust
  33. FluxJustVarargs
  34. FluxFromArray
  35. MonoIdentity
  36. MonoSingle
  37. MonoUsing
  38. MonoUsingWithBoolean
  39. MonoUsingWithConsumer
  40. MonoUsingWithConsumerAndBoolean
  41. MonoUsingWhen
  42. MonoUsingWhenWithBiFunctionAndFunction
  43. FluxIdentity
  44. FluxConcatMap
  45. FluxConcatMapWithInt
  46. MonoFlatMapIterable
  47. MonoFlatMapIterableIdentity
  48. FluxConcatMapIterable
  49. FluxConcatMapIterableWithInt
  50. MonoFlatMapFlux
  51. MonoMap
  52. FluxMap
  53. MonoMapNotNull
  54. FluxMapNotNull
  55. FluxMapNotNullOrElseNull
  56. FluxMapNotNullOptionalOrElseNull
  57. MonoFlux
  58. MonoThen
  59. FluxThen
  60. MonoThenEmpty
  61. FluxThenEmpty
  62. MonoThenMany
  63. MonoThenFlux
  64. FluxThenMany
  65. MonoThenWithMono
  66. FluxThenWithMono
  67. MonoSingleOptional
  68. MonoCastClass
  69. FluxCastClass
  70. MonoOfType
  71. FluxOfType
  72. MonoFlatMap
  73. MonoFlatMapMany
  74. FluxConcatMapIterableIdentity
  75. FluxConcatMapIterableIdentityWithInt
  76. FluxFromIterable
  77. FluxCountMapMathToIntExact
  78. MonoDoOnError
  79. FluxDoOnError
  80. MonoOnErrorComplete
  81. FluxOnErrorComplete
  82. MonoOnErrorCompleteWithClass
  83. FluxOnErrorCompleteWithClass
  84. MonoOnErrorCompleteWithPredicate
  85. FluxOnErrorCompleteWithPredicate
  86. MonoOnErrorContinue
  87. FluxOnErrorContinue
  88. MonoOnErrorMap
  89. FluxOnErrorMap
  90. MonoOnErrorResume
  91. FluxOnErrorResume
  92. MonoOnErrorReturn
  93. FluxOnErrorReturn
  94. FluxFilterSort
  95. FluxFilterSortWithComparator
  96. FluxDistinctSort
  97. FluxDistinctSortWithComparator
  98. FluxTakeWhile
  99. FluxCollectToImmutableList
  100. FluxCollectToImmutableSet
  101. FluxSort
  102. FluxTransformMathFluxMinSingleOrEmpty
  103. FluxTransformMathFluxMinSingleOrEmptyWithComparator
  104. FluxTransformMathFluxMaxSingleOrEmpty
  105. FluxTransformMathFluxMaxSingleOrEmptyWithComparator
  106. MathFluxMin
  107. MathFluxMax
  108. ContextEmpty
  109. PublisherProbeEmpty
  110. PublisherProbeAssertWasSubscribed
  111. PublisherProbeAssertWasNotSubscribed
  112. PublisherProbeAssertWasCancelled
  113. PublisherProbeAssertWasNotCancelled
  114. PublisherProbeAssertWasRequested
  115. PublisherProbeAssertWasNotRequested
  116. AssertThatPublisherProbeWasSubscribedIsEqualTo
  117. AssertThatPublisherProbeWasCancelledIsEqualTo
  118. AssertThatPublisherProbeWasRequestedIsEqualTo
  119. MonoAsStepVerifierCreate
  120. FluxAsStepVerifierCreate
  121. StepVerifierVerify
  122. StepVerifierVerifyWithDuration
  123. StepVerifierVerifyLater
  124. StepIdentity
  125. StepExpectNext
  126. FluxAsStepVerifierCreateExpectNext
  127. LastStepVerifyComplete
  128. LastStepVerifyError
  129. LastStepVerifyErrorWithClass
  130. LastStepVerifyErrorMatches
  131. LastStepVerifyErrorSatisfies
  132. LastStepVerifyErrorSatisfiesAssertThatIsInstanceOfHasMessage
  133. LastStepVerifyErrorMessage
  134. LastStepVerifyTimeout
  135. MonoFromFuture
  136. MonoFromFutureWithBoolean
  137. MonoFromFutureAsyncLoadingCacheGetTrue
  138. MonoFromFutureAsyncLoadingCacheGetAllTrue
  139. FluxFromStream
  140. FluxNext

MonoFromSupplier

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFromSupplier") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFromSupplier).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<?>> testMonoFromSupplier() {
   return ImmutableSet.of(
       Mono.fromCallable((Callable<?>) null),
       Mono.fromCallable(() -> getClass().getDeclaredConstructor()),
-      Mono.fromCallable(() -> toString()),
+      Mono.fromSupplier(() -> toString()),
       Mono.fromCallable(getClass()::getDeclaredConstructor),
-      Mono.fromCallable(this::toString));
+      Mono.fromSupplier(this::toString));
 }

MonoEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoEmpty() {
-  return ImmutableSet.of(Mono.justOrEmpty(null), Mono.justOrEmpty(Optional.empty()));
+  return ImmutableSet.of(Mono.empty(), Mono.empty());
 }

MonoTimeoutMonoEmptyDuration

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoTimeoutMonoEmptyDuration") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoTimeoutMonoEmptyDuration).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoTimeoutMonoEmptyDuration() {
-  return Mono.just(1).timeout(Duration.ofSeconds(2)).onErrorComplete(TimeoutException.class);
+  return Mono.just(1).timeout(Duration.ofSeconds(2), Mono.empty());
 }

MonoTimeoutMonoJustDuration

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoTimeoutMonoJustDuration") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoTimeoutMonoJustDuration).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoTimeoutMonoJustDuration() {
-  return Mono.just(1).timeout(Duration.ofSeconds(2)).onErrorReturn(TimeoutException.class, 3);
+  return Mono.just(1).timeout(Duration.ofSeconds(2), Mono.just(3));
 }

MonoTimeoutDuration

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoTimeoutDuration") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoTimeoutDuration).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMonoTimeoutDuration() {
   return ImmutableSet.of(
-      Mono.just(1)
-          .timeout(Duration.ofSeconds(2))
-          .onErrorResume(TimeoutException.class, e -> Mono.just(toString().hashCode())),
+      Mono.just(1).timeout(Duration.ofSeconds(2), Mono.just(toString().hashCode())),
       Mono.just(3)
           .timeout(Duration.ofSeconds(4))
           .onErrorResume(TimeoutException.class, e -> Mono.just(e.toString().hashCode())));
 }

MonoTimeoutMonoEmptyPublisher

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoTimeoutMonoEmptyPublisher") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoTimeoutMonoEmptyPublisher).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoTimeoutMonoEmptyPublisher() {
-  return Mono.just(1).timeout(Mono.just(2)).onErrorComplete(TimeoutException.class);
+  return Mono.just(1).timeout(Mono.just(2), Mono.empty());
 }

MonoTimeoutMonoJustPublisher

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoTimeoutMonoJustPublisher") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoTimeoutMonoJustPublisher).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoTimeoutMonoJustPublisher() {
-  return Mono.just(1).timeout(Mono.just(2)).onErrorReturn(TimeoutException.class, 3);
+  return Mono.just(1).timeout(Mono.just(2), Mono.just(3));
 }

MonoTimeoutPublisher

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoTimeoutPublisher") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoTimeoutPublisher).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMonoTimeoutPublisher() {
   return ImmutableSet.of(
-      Mono.just(1)
-          .timeout(Mono.just(2))
-          .onErrorResume(TimeoutException.class, e -> Mono.just(toString().hashCode())),
+      Mono.just(1).timeout(Mono.just(2), Mono.just(toString().hashCode())),
       Mono.just(3)
           .timeout(Mono.just(4))
           .onErrorResume(TimeoutException.class, e -> Mono.just(e.toString().hashCode())));
 }

MonoJust

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoJust") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoJust).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMonoJust() {
-  return ImmutableSet.of(Mono.justOrEmpty(Optional.of(1)), Flux.just(2).next());
+  return ImmutableSet.of(Mono.just(1), Mono.just(2));
 }

MonoJustOrEmptyObject

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoJustOrEmptyObject") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoJustOrEmptyObject).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoJustOrEmptyObject() {
-  return Mono.justOrEmpty(Optional.ofNullable(1));
+  return Mono.justOrEmpty(1);
 }

MonoJustOrEmptyOptional

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoJustOrEmptyOptional") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoJustOrEmptyOptional).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoJustOrEmptyOptional() {
-  return Mono.just(Optional.of(1)).filter(Optional::isPresent).map(Optional::orElseThrow);
+  return Mono.justOrEmpty(Optional.of(1));
 }

MonoDeferMonoJustOrEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoDeferMonoJustOrEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoDeferMonoJustOrEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMonoDeferMonoJustOrEmpty() {
   return ImmutableSet.of(
-      Mono.fromCallable(() -> Optional.of(1).orElse(null)),
-      Mono.fromSupplier(() -> Optional.of(2).orElse(null)));
+      Mono.defer(() -> Mono.justOrEmpty(Optional.of(1))),
+      Mono.defer(() -> Mono.justOrEmpty(Optional.of(2))));
 }

OptionalMapMonoJust

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("OptionalMapMonoJust") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$OptionalMapMonoJust).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Optional<Mono<String>> testOptionalMapMonoJust() {
-  return Optional.of("foo").map(Mono::justOrEmpty);
+  return Optional.of("foo").map(Mono::just);
 }

MonoJustOrEmptySwitchIfEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoJustOrEmptySwitchIfEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoJustOrEmptySwitchIfEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoJustOrEmptySwitchIfEmpty() {
-  return Optional.of(1).map(Mono::just).orElse(Mono.just(2));
+  return Mono.justOrEmpty(Optional.of(1)).switchIfEmpty(Mono.just(2));
 }

MonoZip

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoZip") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoZip).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Tuple2<String, Integer>> testMonoZip() {
-  return Mono.just("foo").zipWith(Mono.just(1));
+  return Mono.zip(Mono.just("foo"), Mono.just(1));
 }

MonoZipMapFunction

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoZipMapFunction") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoZipMapFunction).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<String> testMonoZipMapFunction() {
-  return Mono.just("foo").zipWith(Mono.just(1), String::repeat);
+  return Mono.zip(Mono.just("foo"), Mono.just(1)).map(TupleUtils.function(String::repeat));
 }

FluxZip

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxZip") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxZip).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Tuple2<String, Integer>> testFluxZip() {
-  return Flux.just("foo", "bar").zipWith(Flux.just(1, 2));
+  return Flux.zip(Flux.just("foo", "bar"), Flux.just(1, 2));
 }

FluxZipMapFunction

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxZipMapFunction") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxZipMapFunction).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testFluxZipMapFunction() {
-  return Flux.just("foo", "bar").zipWith(Flux.just(1, 2), String::repeat);
+  return Flux.zip(Flux.just("foo", "bar"), Flux.just(1, 2))
+      .map(TupleUtils.function(String::repeat));
 }

FluxZipWithIterable

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxZipWithIterable") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxZipWithIterable).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Tuple2<String, Integer>> testFluxZipWithIterable() {
-  return Flux.zip(Flux.just("foo", "bar"), Flux.fromIterable(ImmutableSet.of(1, 2)));
+  return Flux.just("foo", "bar").zipWithIterable(ImmutableSet.of(1, 2));
 }

FluxZipWithIterableWithBiFunction

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxZipWithIterableWithBiFunction") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxZipWithIterableWithBiFunction).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testFluxZipWithIterableWithBiFunction() {
-  return Flux.just("foo", "bar")
-      .zipWith(Flux.fromIterable(ImmutableSet.of(1, 2)), String::repeat);
+  return Flux.just("foo", "bar").zipWithIterable(ImmutableSet.of(1, 2), String::repeat);
 }

FluxZipWithIterableMapFunction

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxZipWithIterableMapFunction") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxZipWithIterableMapFunction).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testFluxZipWithIterableMapFunction() {
-  return Flux.just("foo", "bar").zipWithIterable(ImmutableSet.of(1, 2), String::repeat);
+  return Flux.just("foo", "bar")
+      .zipWithIterable(ImmutableSet.of(1, 2))
+      .map(function(String::repeat));
 }

MonoErrorThrowable

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoErrorThrowable") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoErrorThrowable).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Void> testMonoErrorThrowable() {
-  return Mono.defer(() -> Mono.error(new IllegalStateException()));
+  return Mono.error(() -> new IllegalStateException());
 }

FluxErrorThrowable

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxErrorThrowable") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxErrorThrowable).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Void> testFluxErrorThrowable() {
-  return Flux.defer(() -> Flux.error(new IllegalStateException()));
+  return Flux.error(() -> new IllegalStateException());
 }

MonoErrorSupplier

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoErrorSupplier") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoErrorSupplier).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Void> testMonoErrorSupplier() {
-  return Mono.error(() -> ((Supplier<RuntimeException>) null).get());
+  return Mono.error(((Supplier<RuntimeException>) null));
 }

FluxErrorSupplier

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxErrorSupplier") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxErrorSupplier).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Void> testFluxErrorSupplier() {
-  return Flux.error(() -> ((Supplier<RuntimeException>) null).get());
+  return Flux.error(((Supplier<RuntimeException>) null));
 }

MonoThenReturn

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoThenReturn") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoThenReturn).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoThenReturn() {
   return ImmutableSet.of(
-      Mono.just(1).ignoreElement().thenReturn("foo"),
-      Mono.just(2).then().thenReturn("bar"),
-      Mono.just(3).then(Mono.just("baz")));
+      Mono.just(1).thenReturn("foo"),
+      Mono.just(2).thenReturn("bar"),
+      Mono.just(3).thenReturn("baz"));
 }

FluxTake

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTake") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTake).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxTake() {
-  return Flux.just(1, 2, 3).take(1, true);
+  return Flux.just(1, 2, 3).take(1);
 }

MonoDefaultIfEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoDefaultIfEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoDefaultIfEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<String> testMonoDefaultIfEmpty() {
-  return Mono.just("foo").switchIfEmpty(Mono.just("bar"));
+  return Mono.just("foo").defaultIfEmpty("bar");
 }

FluxDefaultIfEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxDefaultIfEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxDefaultIfEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testFluxDefaultIfEmpty() {
   return ImmutableSet.of(
-      Flux.just("foo").switchIfEmpty(Mono.just("bar")),
-      Flux.just("baz").switchIfEmpty(Flux.just("qux")));
+      Flux.just("foo").defaultIfEmpty("bar"), Flux.just("baz").defaultIfEmpty("qux"));
 }

FluxEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<?>> testFluxEmpty() {
   return ImmutableSet.of(
-      Flux.zip(v -> v),
-      Flux.zip(v -> v, 1),
-      Flux.concat(),
-      Flux.concatDelayError(),
-      Flux.firstWithSignal(),
-      Flux.just(),
-      Flux.merge(),
-      Flux.merge(1),
-      Flux.mergeComparing((a, b) -> 0),
-      Flux.mergeComparing(1, (a, b) -> 0),
-      Flux.mergeComparingDelayError(1, (a, b) -> 0),
-      Flux.mergeDelayError(1),
-      Flux.mergePriority((a, b) -> 0),
-      Flux.mergePriority(1, (a, b) -> 0),
-      Flux.mergePriorityDelayError(1, (a, b) -> 0),
-      Flux.mergeSequential(),
-      Flux.mergeSequential(1),
-      Flux.mergeSequentialDelayError(1),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
       Flux.fromArray(new String[] {"foo"}),
-      Flux.fromArray(new String[0]),
+      Flux.empty(),
       Flux.fromIterable(Iterables.cycle("bar")),
-      Flux.fromIterable(ImmutableList.of()),
+      Flux.empty(),
       Flux.fromStream(() -> Stream.generate(() -> "baz")),
-      Flux.fromStream(() -> Stream.empty()),
-      Flux.combineLatest(v -> v),
-      Flux.combineLatest(v -> v, 1),
-      Flux.mergeComparing(),
-      Flux.mergePriority(),
-      Flux.range(0, 0));
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty(),
+      Flux.empty());
 }

FluxTimeoutFluxEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTimeoutFluxEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTimeoutFluxEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxTimeoutFluxEmpty() {
-  return Flux.just(1).timeout(Duration.ofSeconds(2)).onErrorComplete(TimeoutException.class);
+  return Flux.just(1).timeout(Duration.ofSeconds(2), Flux.empty());
 }

FluxJust

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxJust") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxJust).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxJust() {
-  return ImmutableSet.of(
-      Flux.range(0, 1),
-      Mono.just(2).flux(),
-      Flux.fromStream(() -> Stream.of(3)),
-      Mono.just(4).repeat().take(1));
+  return ImmutableSet.of(Flux.just(0), Flux.just(2), Flux.just(3), Flux.just(4));
 }

FluxJustVarargs

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxJustVarargs") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxJustVarargs).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testFluxJustVarargs() {
-  return ImmutableSet.of(
-      Flux.fromStream(() -> Stream.of("foo", "bar")),
-      Flux.fromStream(() -> Stream.of("baz", "qux", "quux")));
+  return ImmutableSet.of(Flux.just("foo", "bar"), Flux.just("baz", "qux", "quux"));
 }

FluxFromArray

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxFromArray") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxFromArray).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testFluxFromArray() {
   return ImmutableSet.of(
-      Flux.just(new String[] {"foo"}),
-      Flux.fromStream(() -> Arrays.stream(new String[] {"bar"})));
+      Flux.fromArray(new String[] {"foo"}), Flux.fromArray(new String[] {"bar"}));
 }

MonoIdentity

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoIdentity") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoIdentity).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<?>> testMonoIdentity() {
   return ImmutableSet.of(
-      Mono.just(1).switchIfEmpty(Mono.empty()),
-      Mono.just(2).flux().next(),
-      Mono.just(3).flux().singleOrEmpty(),
-      Mono.<Void>empty().ignoreElement(),
-      Mono.<Void>empty().then(),
-      Mono.<ImmutableList<String>>empty().map(ImmutableList::copyOf));
+      Mono.just(1),
+      Mono.just(2),
+      Mono.just(3),
+      Mono.<Void>empty(),
+      Mono.<Void>empty(),
+      Mono.<ImmutableList<String>>empty());
 }

MonoSingle

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoSingle") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoSingle).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoSingle() {
-  return Mono.just(1).flux().single();
+  return Mono.just(1).single();
 }

MonoUsing

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoUsing") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoUsing).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoUsing() {
   return ImmutableSet.of(
       Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Flux.just("foo")).next(),
-      Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("bar")).next(),
+      Mono.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("bar")),
       Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Flux.just("baz")).single(),
-      Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("qux")).single());
+      Mono.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("qux")));
 }

MonoUsingWithBoolean

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoUsingWithBoolean") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoUsingWithBoolean).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoUsingWithBoolean() {
   return ImmutableSet.of(
       Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Flux.just("foo"), false)
           .next(),
-      Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("bar"), false)
-          .next(),
+      Mono.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("bar"), false),
       Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Flux.just("baz"), true)
           .single(),
-      Flux.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("qux"), true)
-          .single());
+      Mono.using(() -> new ByteArrayInputStream(new byte[0]), v -> Mono.just("qux"), true));
 }

MonoUsingWithConsumer

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoUsingWithConsumer") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoUsingWithConsumer).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoUsingWithConsumer() {
   return ImmutableSet.of(
       Flux.using(() -> 1, v -> Flux.just("foo"), v -> {}).next(),
-      Flux.using(() -> 2, v -> Mono.just("bar"), v -> {}).next(),
+      Mono.using(() -> 2, v -> Mono.just("bar"), v -> {}),
       Flux.using(() -> 3, v -> Flux.just("baz"), v -> {}).single(),
-      Flux.using(() -> 4, v -> Mono.just("qux"), v -> {}).single());
+      Mono.using(() -> 4, v -> Mono.just("qux"), v -> {}));
 }

MonoUsingWithConsumerAndBoolean

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoUsingWithConsumerAndBoolean") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoUsingWithConsumerAndBoolean).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoUsingWithConsumerAndBoolean() {
   return ImmutableSet.of(
       Flux.using(() -> 1, v -> Flux.just("foo"), v -> {}, false).next(),
-      Flux.using(() -> 2, v -> Mono.just("bar"), v -> {}, false).next(),
+      Mono.using(() -> 2, v -> Mono.just("bar"), v -> {}, false),
       Flux.using(() -> 3, v -> Flux.just("baz"), v -> {}, true).single(),
-      Flux.using(() -> 4, v -> Mono.just("qux"), v -> {}, true).single());
+      Mono.using(() -> 4, v -> Mono.just("qux"), v -> {}, true));
 }

MonoUsingWhen

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoUsingWhen") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoUsingWhen).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoUsingWhen() {
   return ImmutableSet.of(
       Flux.usingWhen(Mono.just(1), v -> Flux.just("foo"), v -> Mono.just(2)).next(),
-      Flux.usingWhen(Mono.just(3), v -> Mono.just("bar"), v -> Mono.just(4)).next(),
+      Mono.usingWhen(Mono.just(3), v -> Mono.just("bar"), v -> Mono.just(4)),
       Flux.usingWhen(Mono.just(5), v -> Flux.just("baz"), v -> Mono.just(6)).single(),
-      Flux.usingWhen(Mono.just(7), v -> Mono.just("qux"), v -> Mono.just(8)).single());
+      Mono.usingWhen(Mono.just(7), v -> Mono.just("qux"), v -> Mono.just(8)));
 }

MonoUsingWhenWithBiFunctionAndFunction

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoUsingWhenWithBiFunctionAndFunction") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoUsingWhenWithBiFunctionAndFunction).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoUsingWhenWithBiFunctionAndFunction() {
   return ImmutableSet.of(
       Flux.usingWhen(
               Mono.just(1),
               v -> Flux.just("foo"),
               v -> Mono.just(2),
               (v, t) -> Mono.just(3),
               v -> Mono.just(4))
           .next(),
+      Mono.usingWhen(
+          Mono.just(5),
+          v -> Mono.just("bar"),
+          v -> Mono.just(6),
+          (v, t) -> Mono.just(7),
+          v -> Mono.just(8)),
       Flux.usingWhen(
-              Mono.just(5),
-              v -> Mono.just("bar"),
-              v -> Mono.just(6),
-              (v, t) -> Mono.just(7),
-              v -> Mono.just(8))
-          .next(),
-      Flux.usingWhen(
               Mono.just(9),
               v -> Flux.just("baz"),
               v -> Mono.just(10),
               (v, t) -> Mono.just(11),
               v -> Mono.just(12))
           .single(),
-      Flux.usingWhen(
-              Mono.just(13),
-              v -> Mono.just("qux"),
-              v -> Mono.just(14),
-              (v, t) -> Mono.just(15),
-              v -> Mono.just(16))
-          .single());
+      Mono.usingWhen(
+          Mono.just(13),
+          v -> Mono.just("qux"),
+          v -> Mono.just(14),
+          (v, t) -> Mono.just(15),
+          v -> Mono.just(16)));
 }

FluxIdentity

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxIdentity") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxIdentity).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxIdentity() {
-  return ImmutableSet.of(
-      Flux.just(1).switchIfEmpty(Mono.empty()), Flux.just(2).switchIfEmpty(Flux.empty()));
+  return ImmutableSet.of(Flux.just(1), Flux.just(2));
 }

FluxConcatMap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxConcatMap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxConcatMap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxConcatMap() {
   return ImmutableSet.of(
-      Flux.just(1).concatMap(Mono::just, 0),
-      Flux.just(2).flatMap(Mono::just, 1),
-      Flux.just(3).flatMapSequential(Mono::just, 1),
+      Flux.just(1).concatMap(Mono::just),
+      Flux.just(2).concatMap(Mono::just),
+      Flux.just(3).concatMap(Mono::just),
       Flux.just(4).map(Mono::just).concatMap(v -> Mono.empty()),
-      Flux.just(5).map(Mono::just).concatMap(identity()),
-      Flux.just(6).map(Mono::just).concatMap(v -> v));
+      Flux.just(5).concatMap(Mono::just),
+      Flux.just(6).concatMap(Mono::just));
 }

FluxConcatMapWithInt

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxConcatMapWithInt") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxConcatMapWithInt).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxConcatMapWithInt() {
   return ImmutableSet.of(
-      Flux.just(1).flatMap(Mono::just, 1, 3),
-      Flux.just(2).flatMapSequential(Mono::just, 1, 4),
+      Flux.just(1).concatMap(Mono::just, 3),
+      Flux.just(2).concatMap(Mono::just, 4),
       Flux.just(3).map(Mono::just).concatMap(v -> Mono.empty(), 5),
-      Flux.just(4).map(Mono::just).concatMap(identity(), 6),
-      Flux.just(5).map(Mono::just).concatMap(v -> v, 7));
+      Flux.just(4).concatMap(Mono::just, 6),
+      Flux.just(5).concatMap(Mono::just, 7));
 }

MonoFlatMapIterable

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFlatMapIterable") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFlatMapIterable).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testMonoFlatMapIterable() {
   return ImmutableSet.of(
-      Mono.just(1).map(ImmutableSet::of).flatMapMany(Flux::fromIterable),
+      Mono.just(1).flatMapIterable(ImmutableSet::of),
       Mono.just(2).map(ImmutableSet::of).flatMapIterable(v -> ImmutableSet.of()),
-      Mono.just(3).map(ImmutableSet::of).flatMapIterable(identity()),
-      Mono.just(4).flux().concatMapIterable(ImmutableSet::of));
+      Mono.just(3).flatMapIterable(ImmutableSet::of),
+      Mono.just(4).flatMapIterable(ImmutableSet::of));
 }

MonoFlatMapIterableIdentity

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFlatMapIterableIdentity") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFlatMapIterableIdentity).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testMonoFlatMapIterableIdentity() {
-  return Mono.just(ImmutableSet.of(1)).flatMapMany(Flux::fromIterable);
+  return Mono.just(ImmutableSet.of(1)).flatMapIterable(identity());
 }

FluxConcatMapIterable

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxConcatMapIterable") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxConcatMapIterable).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxConcatMapIterable() {
   return ImmutableSet.of(
-      Flux.just(1).flatMapIterable(ImmutableList::of),
+      Flux.just(1).concatMapIterable(ImmutableList::of),
       Flux.just(2).map(ImmutableList::of).concatMapIterable(v -> ImmutableSet.of()),
-      Flux.just(3).map(ImmutableList::of).concatMapIterable(identity()));
+      Flux.just(3).concatMapIterable(ImmutableList::of));
 }

FluxConcatMapIterableWithInt

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxConcatMapIterableWithInt") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxConcatMapIterableWithInt).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxConcatMapIterableWithInt() {
   return ImmutableSet.of(
-      Flux.just(1).flatMapIterable(ImmutableList::of, 5),
+      Flux.just(1).concatMapIterable(ImmutableList::of, 5),
       Flux.just(2).map(ImmutableList::of).concatMapIterable(v -> ImmutableSet.of(), 5),
-      Flux.just(3).map(ImmutableList::of).concatMapIterable(identity(), 5));
+      Flux.just(3).concatMapIterable(ImmutableList::of, 5));
 }

MonoFlatMapFlux

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFlatMapFlux") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFlatMapFlux).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testMonoFlatMapFlux() {
-  return Mono.just("foo").flatMapMany(s -> Mono.fromSupplier(() -> s + s));
+  return Mono.just("foo").flatMap(s -> Mono.fromSupplier(() -> s + s)).flux();
 }

MonoMap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoMap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoMap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoMap() {
-  return ImmutableSet.of(
-      Mono.just("foo").flatMap(s -> Mono.just(s)),
-      Mono.just("bar").flatMap(s -> Mono.just(s.substring(1))));
+  return ImmutableSet.of(Mono.just("foo").map(s -> s), Mono.just("bar").map(s -> s.substring(1)));
 }

FluxMap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxMap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxMap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxMap() {
   return ImmutableSet.of(
-      Flux.just(1).concatMap(n -> Mono.just(n)),
-      Flux.just(1).concatMap(n -> Flux.just(n * 2)),
-      Flux.just(1).concatMap(n -> Mono.just(n), 3),
-      Flux.just(1).concatMap(n -> Flux.just(n * 2), 3),
-      Flux.just(1).concatMapDelayError(n -> Mono.just(n)),
-      Flux.just(1).concatMapDelayError(n -> Flux.just(n * 2)),
-      Flux.just(1).concatMapDelayError(n -> Mono.just(n), 3),
-      Flux.just(1).concatMapDelayError(n -> Flux.just(n * 2), 3),
-      Flux.just(1).flatMap(n -> Mono.just(n), 3),
-      Flux.just(1).flatMap(n -> Flux.just(n * 2), 3),
-      Flux.just(1).flatMap(n -> Mono.just(n), 3, 4),
-      Flux.just(1).flatMap(n -> Flux.just(n * 2), 3, 4),
-      Flux.just(1).flatMapDelayError(n -> Mono.just(n), 3, 4),
-      Flux.just(1).flatMapDelayError(n -> Flux.just(n * 2), 3, 4),
-      Flux.just(1).flatMapSequential(n -> Mono.just(n), 3),
-      Flux.just(1).flatMapSequential(n -> Flux.just(n * 2), 3),
-      Flux.just(1).flatMapSequential(n -> Mono.just(n), 3, 4),
-      Flux.just(1).flatMapSequential(n -> Flux.just(n * 2), 3, 4),
-      Flux.just(1).flatMapSequentialDelayError(n -> Mono.just(n), 3, 4),
-      Flux.just(1).flatMapSequentialDelayError(n -> Flux.just(n * 2), 3, 4),
-      Flux.just(1).switchMap(n -> Mono.just(n)),
-      Flux.just(1).switchMap(n -> Flux.just(n * 2)));
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2),
+      Flux.just(1).map(n -> n),
+      Flux.just(1).map(n -> n * 2));
 }

MonoMapNotNull

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoMapNotNull") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoMapNotNull).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoMapNotNull() {
   return ImmutableSet.of(
-      Mono.just("foo").flatMap(s -> Mono.justOrEmpty(s)),
-      Mono.just("bar").flatMap(s -> Mono.fromSupplier(() -> s.substring(1))));
+      Mono.just("foo").mapNotNull(s -> s), Mono.just("bar").mapNotNull(s -> s.substring(1)));
 }

FluxMapNotNull

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxMapNotNull") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxMapNotNull).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxMapNotNull() {
   return ImmutableSet.of(
-      Flux.just(1).concatMap(n -> Mono.justOrEmpty(n)),
-      Flux.just(1).concatMap(n -> Mono.fromSupplier(() -> n * 2)),
-      Flux.just(1).concatMap(n -> Mono.justOrEmpty(n), 3),
-      Flux.just(1).concatMap(n -> Mono.fromSupplier(() -> n * 2), 3),
-      Flux.just(1).concatMapDelayError(n -> Mono.justOrEmpty(n)),
-      Flux.just(1).concatMapDelayError(n -> Mono.fromSupplier(() -> n * 2)),
-      Flux.just(1).concatMapDelayError(n -> Mono.justOrEmpty(n), 3),
-      Flux.just(1).concatMapDelayError(n -> Mono.fromSupplier(() -> n * 2), 3),
-      Flux.just(1).flatMap(n -> Mono.justOrEmpty(n), 3),
-      Flux.just(1).flatMap(n -> Mono.fromSupplier(() -> n * 2), 3),
-      Flux.just(1).flatMap(n -> Mono.justOrEmpty(n), 3, 4),
-      Flux.just(1).flatMap(n -> Mono.fromSupplier(() -> n * 2), 3, 4),
-      Flux.just(1).flatMapDelayError(n -> Mono.justOrEmpty(n), 3, 4),
-      Flux.just(1).flatMapDelayError(n -> Mono.fromSupplier(() -> n * 2), 3, 4),
-      Flux.just(1).flatMapSequential(n -> Mono.justOrEmpty(n), 3),
-      Flux.just(1).flatMapSequential(n -> Mono.fromSupplier(() -> n * 2), 3),
-      Flux.just(1).flatMapSequential(n -> Mono.justOrEmpty(n), 3, 4),
-      Flux.just(1).flatMapSequential(n -> Mono.fromSupplier(() -> n * 2), 3, 4),
-      Flux.just(1).flatMapSequentialDelayError(n -> Mono.justOrEmpty(n), 3, 4),
-      Flux.just(1).flatMapSequentialDelayError(n -> Mono.fromSupplier(() -> n * 2), 3, 4),
-      Flux.just(1).switchMap(n -> Mono.justOrEmpty(n)),
-      Flux.just(1).switchMap(n -> Mono.fromSupplier(() -> n * 2)));
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2),
+      Flux.just(1).mapNotNull(n -> n),
+      Flux.just(1).mapNotNull(n -> n * 2));
 }

FluxMapNotNullOrElseNull

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxMapNotNullOrElseNull") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxMapNotNullOrElseNull).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testFluxMapNotNullOrElseNull() {
-  return Flux.just(1).map(x -> Optional.of(x.toString())).mapNotNull(x -> x.orElse(null));
+  return Flux.just(1).mapNotNull(x -> Optional.of(x.toString()).orElse(null));
 }

FluxMapNotNullOptionalOrElseNull

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxMapNotNullOptionalOrElseNull") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxMapNotNullOptionalOrElseNull).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxMapNotNullOptionalOrElseNull() {
-  return Flux.just(Optional.of(1)).filter(Optional::isPresent).map(Optional::orElseThrow);
+  return Flux.just(Optional.of(1)).mapNotNull(x -> x.orElse(null));
 }

MonoFlux

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFlux") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFlux).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testMonoFlux() {
   return ImmutableSet.of(
-      Mono.just("foo").flatMapMany(Mono::just),
-      Mono.just("bar").flatMapMany(Flux::just),
-      Flux.concat(Mono.just("baz")));
+      Mono.just("foo").flux(), Mono.just("bar").flux(), Mono.just("baz").flux());
 }

MonoThen

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoThen") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoThen).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Void>> testMonoThen() {
   return ImmutableSet.of(
-      Mono.just("foo").ignoreElement().then(),
-      Mono.just("bar").flux().then(),
-      Mono.when(Mono.just("baz")),
-      Mono.whenDelayError(Mono.just("qux")));
+      Mono.just("foo").then(),
+      Mono.just("bar").then(),
+      Mono.just("baz").then(),
+      Mono.just("qux").then());
 }

FluxThen

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxThen") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxThen).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Void>> testFluxThen() {
-  return ImmutableSet.of(
-      Flux.just("foo").ignoreElements().then(), Flux.<Void>empty().ignoreElements());
+  return ImmutableSet.of(Flux.just("foo").then(), Flux.<Void>empty().then());
 }

MonoThenEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoThenEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoThenEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Void> testMonoThenEmpty() {
-  return Mono.just("foo").ignoreElement().thenEmpty(Mono.empty());
+  return Mono.just("foo").thenEmpty(Mono.empty());
 }

FluxThenEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxThenEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxThenEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Void> testFluxThenEmpty() {
-  return Flux.just("foo").ignoreElements().thenEmpty(Mono.empty());
+  return Flux.just("foo").thenEmpty(Mono.empty());
 }

MonoThenMany

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoThenMany") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoThenMany).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testMonoThenMany() {
   return ImmutableSet.of(
-      Mono.just("foo").ignoreElement().thenMany(Flux.just("bar")),
-      Mono.just("baz").ignoreElement().thenMany(Flux.just("qux")));
+      Mono.just("foo").thenMany(Flux.just("bar")), Mono.just("baz").thenMany(Flux.just("qux")));
 }

MonoThenFlux

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoThenFlux") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoThenFlux).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testMonoThenFlux() {
-  return Mono.just("foo").thenMany(Mono.just("bar"));
+  return Mono.just("foo").then(Mono.just("bar")).flux();
 }

FluxThenMany

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxThenMany") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxThenMany).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<String> testFluxThenMany() {
-  return Flux.just("foo").ignoreElements().thenMany(Flux.just("bar"));
+  return Flux.just("foo").thenMany(Flux.just("bar"));
 }

MonoThenWithMono

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoThenWithMono") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoThenWithMono).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<?>> testMonoThenWithMono() {
   return ImmutableSet.of(
-      Mono.just("foo").ignoreElement().then(Mono.just("bar")),
-      Mono.just("baz").flux().then(Mono.just("qux")),
-      Mono.just("quux").thenEmpty(Mono.<Void>empty()));
+      Mono.just("foo").then(Mono.just("bar")),
+      Mono.just("baz").then(Mono.just("qux")),
+      Mono.just("quux").then(Mono.<Void>empty()));
 }

FluxThenWithMono

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxThenWithMono") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxThenWithMono).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<?>> testFluxThenWithMono() {
   return ImmutableSet.of(
-      Flux.just("foo").ignoreElements().then(Mono.just("bar")),
-      Flux.just("baz").thenEmpty(Mono.<Void>empty()));
+      Flux.just("foo").then(Mono.just("bar")), Flux.just("baz").then(Mono.<Void>empty()));
 }

MonoSingleOptional

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoSingleOptional") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoSingleOptional).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Optional<String>>> testMonoSingleOptional() {
   return ImmutableSet.of(
-      Mono.just("foo").flux().collect(toOptional()),
-      Mono.just("bar").map(Optional::of).defaultIfEmpty(Optional.empty()),
-      Mono.just("baz").singleOptional().defaultIfEmpty(Optional.empty()),
-      Mono.just("quux").singleOptional().switchIfEmpty(Mono.just(Optional.empty())),
-      Mono.just("quuz").transform(Mono::singleOptional));
+      Mono.just("foo").singleOptional(),
+      Mono.just("bar").singleOptional(),
+      Mono.just("baz").singleOptional(),
+      Mono.just("quux").singleOptional(),
+      Mono.just("quuz").singleOptional());
 }

MonoCastClass

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoCastClass") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoCastClass).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Number> testMonoCastClass() {
-  return Mono.just(1).map(Number.class::cast);
+  return Mono.just(1).cast(Number.class);
 }

FluxCastClass

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxCastClass") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxCastClass).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Number> testFluxCastClass() {
-  return Flux.just(1).map(Number.class::cast);
+  return Flux.just(1).cast(Number.class);
 }

MonoOfType

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOfType") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOfType).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Number> testMonoOfType() {
-  return Mono.just(1).filter(Number.class::isInstance).cast(Number.class);
+  return Mono.just(1).ofType(Number.class);
 }

FluxOfType

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOfType") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOfType).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Number> testFluxOfType() {
-  return Flux.just(1).filter(Number.class::isInstance).cast(Number.class);
+  return Flux.just(1).ofType(Number.class);
 }

MonoFlatMap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFlatMap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFlatMap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<String>> testMonoFlatMap() {
   return ImmutableSet.of(
       Mono.just("foo").map(Mono::just).flatMap(v -> Mono.empty()),
-      Mono.just("bar").map(Mono::just).flatMap(identity()));
+      Mono.just("bar").flatMap(Mono::just));
 }

MonoFlatMapMany

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFlatMapMany") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFlatMapMany).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testMonoFlatMapMany() {
   return ImmutableSet.of(
       Mono.just(1).map(Mono::just).flatMapMany(v -> Flux.empty()),
-      Mono.just(2).map(Mono::just).flatMapMany(identity()),
-      Mono.just(3).flux().concatMap(Mono::just),
-      Mono.just(4).flux().concatMap(Mono::just, 2),
-      Mono.just(5).flux().concatMapDelayError(Mono::just),
-      Mono.just(6).flux().concatMapDelayError(Mono::just, 2),
-      Mono.just(7).flux().concatMapDelayError(Mono::just, false, 2),
-      Mono.just(8).flux().flatMap(Mono::just, 2),
-      Mono.just(9).flux().flatMap(Mono::just, 2, 3),
-      Mono.just(10).flux().flatMapDelayError(Mono::just, 2, 3),
-      Mono.just(11).flux().flatMapSequential(Mono::just, 2),
-      Mono.just(12).flux().flatMapSequential(Mono::just, 2, 3),
-      Mono.just(13).flux().flatMapSequentialDelayError(Mono::just, 2, 3),
-      Mono.just(14).flux().switchMap(Mono::just));
+      Mono.just(2).flatMapMany(Mono::just),
+      Mono.just(3).flatMapMany(Mono::just),
+      Mono.just(4).flatMapMany(Mono::just),
+      Mono.just(5).flatMapMany(Mono::just),
+      Mono.just(6).flatMapMany(Mono::just),
+      Mono.just(7).flatMapMany(Mono::just),
+      Mono.just(8).flatMapMany(Mono::just),
+      Mono.just(9).flatMapMany(Mono::just),
+      Mono.just(10).flatMapMany(Mono::just),
+      Mono.just(11).flatMapMany(Mono::just),
+      Mono.just(12).flatMapMany(Mono::just),
+      Mono.just(13).flatMapMany(Mono::just),
+      Mono.just(14).flatMapMany(Mono::just));
 }

FluxConcatMapIterableIdentity

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxConcatMapIterableIdentity") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxConcatMapIterableIdentity).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testFluxConcatMapIterableIdentity() {
   return ImmutableSet.of(
-      Flux.just(ImmutableList.of("foo")).concatMap(list -> Flux.fromIterable(list)),
-      Flux.just(ImmutableList.of("bar")).concatMap(Flux::fromIterable));
+      Flux.just(ImmutableList.of("foo")).concatMapIterable(identity()),
+      Flux.just(ImmutableList.of("bar")).concatMapIterable(identity()));
 }

FluxConcatMapIterableIdentityWithInt

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxConcatMapIterableIdentityWithInt") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxConcatMapIterableIdentityWithInt).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testFluxConcatMapIterableIdentityWithInt() {
   return ImmutableSet.of(
-      Flux.just(ImmutableList.of("foo")).concatMap(list -> Flux.fromIterable(list), 1),
-      Flux.just(ImmutableList.of("bar")).concatMap(Flux::fromIterable, 2));
+      Flux.just(ImmutableList.of("foo")).concatMapIterable(identity(), 1),
+      Flux.just(ImmutableList.of("bar")).concatMapIterable(identity(), 2));
 }

FluxFromIterable

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxFromIterable") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxFromIterable).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<String>> testFluxFromIterable() {
   return ImmutableSet.of(
-      Flux.fromStream(ImmutableList.of("foo")::stream),
-      Flux.fromStream(() -> ImmutableList.of("bar").stream()));
+      Flux.fromIterable(ImmutableList.of("foo")), Flux.fromIterable(ImmutableList.of("bar")));
 }

FluxCountMapMathToIntExact

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxCountMapMathToIntExact") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxCountMapMathToIntExact).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testFluxCountMapMathToIntExact() {
   return ImmutableSet.of(
-      Flux.just(1).collect(toImmutableList()).map(Collection::size),
-      Flux.just(2).collect(toImmutableList()).map(List::size),
-      Flux.just(3).collect(toImmutableList()).map(ImmutableCollection::size),
-      Flux.just(4).collect(toImmutableList()).map(ImmutableList::size),
-      Flux.just(5).collect(toCollection(ArrayList::new)).map(Collection::size),
-      Flux.just(6).collect(toCollection(ArrayList::new)).map(List::size));
+      Flux.just(1).count().map(Math::toIntExact),
+      Flux.just(2).count().map(Math::toIntExact),
+      Flux.just(3).count().map(Math::toIntExact),
+      Flux.just(4).count().map(Math::toIntExact),
+      Flux.just(5).count().map(Math::toIntExact),
+      Flux.just(6).count().map(Math::toIntExact));
 }

MonoDoOnError

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoDoOnError") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoDoOnError).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoDoOnError() {
-  return Mono.just(1).doOnError(IllegalArgumentException.class::isInstance, e -> {});
+  return Mono.just(1).doOnError(IllegalArgumentException.class, e -> {});
 }

FluxDoOnError

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxDoOnError") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxDoOnError).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxDoOnError() {
-  return Flux.just(1).doOnError(IllegalArgumentException.class::isInstance, e -> {});
+  return Flux.just(1).doOnError(IllegalArgumentException.class, e -> {});
 }

MonoOnErrorComplete

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorComplete") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorComplete).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMonoOnErrorComplete() {
   return ImmutableSet.of(
-      Mono.just(1).onErrorResume(e -> Mono.empty()),
-      Mono.just(2).onErrorComplete().doOnError(e -> {}),
-      Mono.just(3).onErrorComplete().doOnError(IllegalArgumentException.class, e -> {}),
-      Mono.just(4).onErrorComplete().doOnError(e -> true, e -> {}));
+      Mono.just(1).onErrorComplete(),
+      Mono.just(2).onErrorComplete(),
+      Mono.just(3).onErrorComplete(),
+      Mono.just(4).onErrorComplete());
 }

FluxOnErrorComplete

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorComplete") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorComplete).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxOnErrorComplete() {
   return ImmutableSet.of(
-      Flux.just(1).onErrorResume(e -> Mono.empty()),
-      Flux.just(2).onErrorResume(e -> Flux.empty()),
-      Flux.just(3).onErrorComplete().doOnError(e -> {}),
-      Flux.just(4).onErrorComplete().doOnError(IllegalArgumentException.class, e -> {}),
-      Flux.just(5).onErrorComplete().doOnError(e -> true, e -> {}));
+      Flux.just(1).onErrorComplete(),
+      Flux.just(2).onErrorComplete(),
+      Flux.just(3).onErrorComplete(),
+      Flux.just(4).onErrorComplete(),
+      Flux.just(5).onErrorComplete());
 }

MonoOnErrorCompleteWithClass

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorCompleteWithClass") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorCompleteWithClass).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMonoOnErrorCompleteWithClass() {
   return ImmutableSet.of(
-      Mono.just(1).onErrorComplete(IllegalArgumentException.class::isInstance),
-      Mono.just(2).onErrorResume(IllegalStateException.class, e -> Mono.empty()));
+      Mono.just(1).onErrorComplete(IllegalArgumentException.class),
+      Mono.just(2).onErrorComplete(IllegalStateException.class));
 }

FluxOnErrorCompleteWithClass

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorCompleteWithClass") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorCompleteWithClass).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxOnErrorCompleteWithClass() {
   return ImmutableSet.of(
-      Flux.just(1).onErrorComplete(IllegalArgumentException.class::isInstance),
-      Flux.just(2).onErrorResume(IllegalStateException.class, e -> Mono.empty()),
-      Flux.just(3).onErrorResume(AssertionError.class, e -> Flux.empty()));
+      Flux.just(1).onErrorComplete(IllegalArgumentException.class),
+      Flux.just(2).onErrorComplete(IllegalStateException.class),
+      Flux.just(3).onErrorComplete(AssertionError.class));
 }

MonoOnErrorCompleteWithPredicate

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorCompleteWithPredicate") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorCompleteWithPredicate).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoOnErrorCompleteWithPredicate() {
-  return Mono.just(1).onErrorResume(e -> e.getCause() == null, e -> Mono.empty());
+  return Mono.just(1).onErrorComplete(e -> e.getCause() == null);
 }

FluxOnErrorCompleteWithPredicate

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorCompleteWithPredicate") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorCompleteWithPredicate).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Flux<Integer>> testFluxOnErrorCompleteWithPredicate() {
   return ImmutableSet.of(
-      Flux.just(1).onErrorResume(e -> e.getCause() == null, e -> Mono.empty()),
-      Flux.just(2).onErrorResume(e -> e.getCause() != null, e -> Flux.empty()));
+      Flux.just(1).onErrorComplete(e -> e.getCause() == null),
+      Flux.just(2).onErrorComplete(e -> e.getCause() != null));
 }

MonoOnErrorContinue

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorContinue") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorContinue).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoOnErrorContinue() {
-  return Mono.just(1).onErrorContinue(IllegalArgumentException.class::isInstance, (e, v) -> {});
+  return Mono.just(1).onErrorContinue(IllegalArgumentException.class, (e, v) -> {});
 }

FluxOnErrorContinue

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorContinue") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorContinue).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxOnErrorContinue() {
-  return Flux.just(1).onErrorContinue(IllegalArgumentException.class::isInstance, (e, v) -> {});
+  return Flux.just(1).onErrorContinue(IllegalArgumentException.class, (e, v) -> {});
 }

MonoOnErrorMap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorMap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorMap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoOnErrorMap() {
-  return Mono.just(1).onErrorMap(IllegalArgumentException.class::isInstance, e -> e);
+  return Mono.just(1).onErrorMap(IllegalArgumentException.class, e -> e);
 }

FluxOnErrorMap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorMap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorMap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxOnErrorMap() {
-  return Flux.just(1).onErrorMap(IllegalArgumentException.class::isInstance, e -> e);
+  return Flux.just(1).onErrorMap(IllegalArgumentException.class, e -> e);
 }

MonoOnErrorResume

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorResume") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorResume).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoOnErrorResume() {
-  return Mono.just(1)
-      .onErrorResume(IllegalArgumentException.class::isInstance, e -> Mono.just(2));
+  return Mono.just(1).onErrorResume(IllegalArgumentException.class, e -> Mono.just(2));
 }

FluxOnErrorResume

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorResume") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorResume).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxOnErrorResume() {
-  return Flux.just(1)
-      .onErrorResume(IllegalArgumentException.class::isInstance, e -> Flux.just(2));
+  return Flux.just(1).onErrorResume(IllegalArgumentException.class, e -> Flux.just(2));
 }

MonoOnErrorReturn

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoOnErrorReturn") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoOnErrorReturn).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testMonoOnErrorReturn() {
-  return Mono.just(1).onErrorReturn(IllegalArgumentException.class::isInstance, 2);
+  return Mono.just(1).onErrorReturn(IllegalArgumentException.class, 2);
 }

FluxOnErrorReturn

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxOnErrorReturn") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxOnErrorReturn).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxOnErrorReturn() {
-  return Flux.just(1).onErrorReturn(IllegalArgumentException.class::isInstance, 2);
+  return Flux.just(1).onErrorReturn(IllegalArgumentException.class, 2);
 }

FluxFilterSort

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxFilterSort") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxFilterSort).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxFilterSort() {
-  return Flux.just(1).sort().filter(i -> i % 2 == 0);
+  return Flux.just(1).filter(i -> i % 2 == 0).sort();
 }

FluxFilterSortWithComparator

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxFilterSortWithComparator") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxFilterSortWithComparator).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxFilterSortWithComparator() {
-  return Flux.just(1).sort(reverseOrder()).filter(i -> i % 2 == 0);
+  return Flux.just(1).filter(i -> i % 2 == 0).sort(reverseOrder());
 }

FluxDistinctSort

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxDistinctSort") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxDistinctSort).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxDistinctSort() {
-  return Flux.just(1).sort().distinct();
+  return Flux.just(1).distinct().sort();
 }

FluxDistinctSortWithComparator

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxDistinctSortWithComparator") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxDistinctSortWithComparator).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxDistinctSortWithComparator() {
-  return Flux.just(1).sort(reverseOrder()).distinct();
+  return Flux.just(1).distinct().sort(reverseOrder());
 }

FluxTakeWhile

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTakeWhile") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTakeWhile).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxTakeWhile() {
-  return Flux.just(1, 2, 3).takeWhile(i -> i % 2 == 0).filter(i -> i % 2 == 0);
+  return Flux.just(1, 2, 3).takeWhile(i -> i % 2 == 0);
 }

FluxCollectToImmutableList

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxCollectToImmutableList") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxCollectToImmutableList).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<List<Integer>> testFluxCollectToImmutableList() {
-  return Flux.just(1).collectList();
+  return Flux.just(1).collect(toImmutableList());
 }

FluxCollectToImmutableSet

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxCollectToImmutableSet") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxCollectToImmutableSet).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<ImmutableSet<Integer>> testFluxCollectToImmutableSet() {
-  return Flux.just(1).collect(toImmutableList()).map(ImmutableSet::copyOf);
+  return Flux.just(1).collect(toImmutableSet());
 }

FluxSort

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxSort") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxSort).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxSort() {
-  return Flux.just(1).sort(naturalOrder());
+  return Flux.just(1).sort();
 }

FluxTransformMathFluxMinSingleOrEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTransformMathFluxMinSingleOrEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTransformMathFluxMinSingleOrEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testFluxTransformMathFluxMinSingleOrEmpty() {
-  return Flux.just(1).sort().next();
+  return Flux.just(1).transform(MathFlux::min).singleOrEmpty();
 }

FluxTransformMathFluxMinSingleOrEmptyWithComparator

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTransformMathFluxMinSingleOrEmptyWithComparator") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTransformMathFluxMinSingleOrEmptyWithComparator).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testFluxTransformMathFluxMinSingleOrEmptyWithComparator() {
   return ImmutableSet.of(
-      Flux.just(1).sort(reverseOrder()).next(),
-      Flux.just(2).collect(minBy(reverseOrder())).flatMap(Mono::justOrEmpty));
+      Flux.just(1).transform(f -> MathFlux.min(f, reverseOrder())).singleOrEmpty(),
+      Flux.just(2).transform(f -> MathFlux.min(f, reverseOrder())).singleOrEmpty());
 }

FluxTransformMathFluxMaxSingleOrEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTransformMathFluxMaxSingleOrEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTransformMathFluxMaxSingleOrEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Integer> testFluxTransformMathFluxMaxSingleOrEmpty() {
-  return Flux.just(1).sort().last();
+  return Flux.just(1).transform(MathFlux::max).singleOrEmpty();
 }

FluxTransformMathFluxMaxSingleOrEmptyWithComparator

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxTransformMathFluxMaxSingleOrEmptyWithComparator") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxTransformMathFluxMaxSingleOrEmptyWithComparator).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testFluxTransformMathFluxMaxSingleOrEmptyWithComparator() {
   return ImmutableSet.of(
-      Flux.just(1).sort(reverseOrder()).last(),
-      Flux.just(2).collect(maxBy(reverseOrder())).flatMap(Mono::justOrEmpty));
+      Flux.just(1).transform(f -> MathFlux.max(f, reverseOrder())).singleOrEmpty(),
+      Flux.just(2).transform(f -> MathFlux.max(f, reverseOrder())).singleOrEmpty());
 }

MathFluxMin

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MathFluxMin") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MathFluxMin).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMathFluxMin() {
-  return ImmutableSet.of(
-      MathFlux.min(Flux.just(1), naturalOrder()), MathFlux.max(Flux.just(2), reverseOrder()));
+  return ImmutableSet.of(MathFlux.min(Flux.just(1)), MathFlux.min(Flux.just(2)));
 }

MathFluxMax

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MathFluxMax") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MathFluxMax).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Mono<Integer>> testMathFluxMax() {
-  return ImmutableSet.of(
-      MathFlux.min(Flux.just(1), reverseOrder()), MathFlux.max(Flux.just(2), naturalOrder()));
+  return ImmutableSet.of(MathFlux.max(Flux.just(1)), MathFlux.max(Flux.just(2)));
 }

ContextEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("ContextEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$ContextEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Context> testContextEmpty() {
-  return ImmutableSet.of(Context.of(ImmutableMap.of(1, 2)), Context.of(ImmutableMap.of()));
+  return ImmutableSet.of(Context.of(ImmutableMap.of(1, 2)), Context.empty());
 }

PublisherProbeEmpty

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeEmpty") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeEmpty).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<PublisherProbe<Void>> testPublisherProbeEmpty() {
-  return ImmutableSet.of(PublisherProbe.of(Mono.empty()), PublisherProbe.of(Flux.empty()));
+  return ImmutableSet.of(PublisherProbe.empty(), PublisherProbe.empty());
 }

PublisherProbeAssertWasSubscribed

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeAssertWasSubscribed") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeAssertWasSubscribed).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 void testPublisherProbeAssertWasSubscribed() {
-  assertThat(PublisherProbe.of(Mono.just(1)).wasSubscribed()).isTrue();
-  assertThat(PublisherProbe.of(Mono.just(2)).subscribeCount()).isNotNegative();
-  assertThat(PublisherProbe.of(Mono.just(3)).subscribeCount()).isNotEqualTo(0);
-  assertThat(PublisherProbe.of(Mono.just(4)).subscribeCount()).isPositive();
+  PublisherProbe.of(Mono.just(1)).assertWasSubscribed();
+  PublisherProbe.of(Mono.just(2)).assertWasSubscribed();
+  PublisherProbe.of(Mono.just(3)).assertWasSubscribed();
+  PublisherProbe.of(Mono.just(4)).assertWasSubscribed();
 }

PublisherProbeAssertWasNotSubscribed

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeAssertWasNotSubscribed") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeAssertWasNotSubscribed).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 void testPublisherProbeAssertWasNotSubscribed() {
-  assertThat(PublisherProbe.of(Mono.just(1)).wasSubscribed()).isFalse();
-  assertThat(PublisherProbe.of(Mono.just(2)).subscribeCount()).isEqualTo(0);
-  assertThat(PublisherProbe.of(Mono.just(3)).subscribeCount()).isNotPositive();
+  PublisherProbe.of(Mono.just(1)).assertWasNotSubscribed();
+  PublisherProbe.of(Mono.just(2)).assertWasNotSubscribed();
+  PublisherProbe.of(Mono.just(3)).assertWasNotSubscribed();
 }

PublisherProbeAssertWasCancelled

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeAssertWasCancelled") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeAssertWasCancelled).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 void testPublisherProbeAssertWasCancelled() {
-  assertThat(PublisherProbe.empty().wasCancelled()).isTrue();
+  PublisherProbe.empty().assertWasCancelled();
 }

PublisherProbeAssertWasNotCancelled

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeAssertWasNotCancelled") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeAssertWasNotCancelled).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 void testPublisherProbeAssertWasNotCancelled() {
-  assertThat(PublisherProbe.empty().wasCancelled()).isFalse();
+  PublisherProbe.empty().assertWasNotCancelled();
 }

PublisherProbeAssertWasRequested

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeAssertWasRequested") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeAssertWasRequested).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 void testPublisherProbeAssertWasRequested() {
-  assertThat(PublisherProbe.empty().wasRequested()).isTrue();
+  PublisherProbe.empty().assertWasRequested();
 }

PublisherProbeAssertWasNotRequested

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PublisherProbeAssertWasNotRequested") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$PublisherProbeAssertWasNotRequested).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 void testPublisherProbeAssertWasNotRequested() {
-  assertThat(PublisherProbe.empty().wasRequested()).isFalse();
+  PublisherProbe.empty().assertWasNotRequested();
 }

AssertThatPublisherProbeWasSubscribedIsEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AssertThatPublisherProbeWasSubscribedIsEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$AssertThatPublisherProbeWasSubscribedIsEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 @SuppressWarnings("SimplifyBooleanExpression" /* Tests use dummy statements. */)
 void testAssertThatPublisherProbeWasSubscribedIsEqualTo() {
-  if (true) {
-    PublisherProbe.of(Mono.just(1)).assertWasSubscribed();
-  } else {
-    PublisherProbe.of(Mono.just(1)).assertWasNotSubscribed();
-  }
-  if (!false) {
-    PublisherProbe.of(Mono.just(2)).assertWasNotSubscribed();
-  } else {
-    PublisherProbe.of(Mono.just(2)).assertWasSubscribed();
-  }
+  assertThat(PublisherProbe.of(Mono.just(1)).wasSubscribed()).isEqualTo(true);
+  assertThat(PublisherProbe.of(Mono.just(2)).wasSubscribed()).isEqualTo(false);
 }

AssertThatPublisherProbeWasCancelledIsEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AssertThatPublisherProbeWasCancelledIsEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$AssertThatPublisherProbeWasCancelledIsEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 @SuppressWarnings("SimplifyBooleanExpression" /* Tests use dummy statements. */)
 void testAssertThatPublisherProbeWasCancelledIsEqualTo() {
-  if (true) {
-    PublisherProbe.of(Mono.just(1)).assertWasCancelled();
-  } else {
-    PublisherProbe.of(Mono.just(1)).assertWasNotCancelled();
-  }
-  if (!false) {
-    PublisherProbe.of(Mono.just(2)).assertWasNotCancelled();
-  } else {
-    PublisherProbe.of(Mono.just(2)).assertWasCancelled();
-  }
+  assertThat(PublisherProbe.of(Mono.just(1)).wasCancelled()).isEqualTo(true);
+  assertThat(PublisherProbe.of(Mono.just(2)).wasCancelled()).isEqualTo(false);
 }

AssertThatPublisherProbeWasRequestedIsEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AssertThatPublisherProbeWasRequestedIsEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$AssertThatPublisherProbeWasRequestedIsEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 @SuppressWarnings("SimplifyBooleanExpression" /* Tests use dummy statements. */)
 void testAssertThatPublisherProbeWasRequestedIsEqualTo() {
-  if (true) {
-    PublisherProbe.of(Mono.just(1)).assertWasRequested();
-  } else {
-    PublisherProbe.of(Mono.just(1)).assertWasNotRequested();
-  }
-  if (!false) {
-    PublisherProbe.of(Mono.just(2)).assertWasNotRequested();
-  } else {
-    PublisherProbe.of(Mono.just(2)).assertWasRequested();
-  }
+  assertThat(PublisherProbe.of(Mono.just(1)).wasRequested()).isEqualTo(true);
+  assertThat(PublisherProbe.of(Mono.just(2)).wasRequested()).isEqualTo(false);
 }

MonoAsStepVerifierCreate

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoAsStepVerifierCreate") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoAsStepVerifierCreate).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<StepVerifier.FirstStep<Integer>> testMonoAsStepVerifierCreate() {
   return ImmutableSet.of(
-      StepVerifier.create(Mono.just(1)), Mono.just(2).flux().as(StepVerifier::create));
+      Mono.just(1).as(StepVerifier::create), Mono.just(2).as(StepVerifier::create));
 }

FluxAsStepVerifierCreate

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxAsStepVerifierCreate") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxAsStepVerifierCreate).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 StepVerifier.FirstStep<Integer> testFluxAsStepVerifierCreate() {
-  return StepVerifier.create(Flux.just(1));
+  return Flux.just(1).as(StepVerifier::create);
 }

StepVerifierVerify

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("StepVerifierVerify") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$StepVerifierVerify).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Object testStepVerifierVerify() {
-  return Mono.empty().as(StepVerifier::create).expectError().verifyThenAssertThat();
+  return Mono.empty().as(StepVerifier::create).expectError().verify();
 }

StepVerifierVerifyWithDuration

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("StepVerifierVerifyWithDuration") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$StepVerifierVerifyWithDuration).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Object testStepVerifierVerifyWithDuration() {
-  return Mono.empty().as(StepVerifier::create).expectError().verifyThenAssertThat(Duration.ZERO);
+  return Mono.empty().as(StepVerifier::create).expectError().verify(Duration.ZERO);
 }

StepVerifierVerifyLater

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("StepVerifierVerifyLater") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$StepVerifierVerifyLater).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 StepVerifier testStepVerifierVerifyLater() {
-  return Mono.empty().as(StepVerifier::create).expectError().verifyLater().verifyLater();
+  return Mono.empty().as(StepVerifier::create).expectError().verifyLater();
 }

StepIdentity

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("StepIdentity") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$StepIdentity).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<StepVerifier.Step<Integer>> testStepIdentity() {
   return ImmutableSet.of(
-      Mono.just(1).as(StepVerifier::create).expectNext(),
-      Mono.just(2).as(StepVerifier::create).expectNextCount(0L),
+      Mono.just(1).as(StepVerifier::create),
+      Mono.just(2).as(StepVerifier::create),
       Mono.just(3).as(StepVerifier::create).expectNextSequence(ImmutableList.of(4)),
-      Mono.just(5).as(StepVerifier::create).expectNextSequence(ImmutableList.of()));
+      Mono.just(5).as(StepVerifier::create));
 }

StepExpectNext

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("StepExpectNext") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$StepExpectNext).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<StepVerifier.Step<String>> testStepExpectNext() {
   return ImmutableSet.of(
-      Mono.just("foo").as(StepVerifier::create).expectNextMatches(s -> s.equals("bar")),
-      Mono.just("baz").as(StepVerifier::create).expectNextMatches("qux"::equals));
+      Mono.just("foo").as(StepVerifier::create).expectNext("bar"),
+      Mono.just("baz").as(StepVerifier::create).expectNext("qux"));
 }

FluxAsStepVerifierCreateExpectNext

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxAsStepVerifierCreateExpectNext") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxAsStepVerifierCreateExpectNext).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 StepVerifier.Step<?> testFluxAsStepVerifierCreateExpectNext() {
-  return Flux.just(1)
-      .collect(toImmutableList())
-      .as(StepVerifier::create)
-      .assertNext(list -> assertThat(list).containsExactly(2));
+  return Flux.just(1).as(StepVerifier::create).expectNext(2);
 }

LastStepVerifyComplete

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyComplete") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyComplete).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Duration testLastStepVerifyComplete() {
-  return Mono.empty().as(StepVerifier::create).expectComplete().verify();
+  return Mono.empty().as(StepVerifier::create).verifyComplete();
 }

LastStepVerifyError

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyError") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyError).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Duration testLastStepVerifyError() {
-  return Mono.empty().as(StepVerifier::create).expectError().verify();
+  return Mono.empty().as(StepVerifier::create).verifyError();
 }

LastStepVerifyErrorWithClass

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyErrorWithClass") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyErrorWithClass).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<Duration> testLastStepVerifyErrorWithClass() {
   return ImmutableSet.of(
-      Mono.empty().as(StepVerifier::create).expectError(IllegalArgumentException.class).verify(),
-      Mono.empty()
-          .as(StepVerifier::create)
-          .verifyErrorMatches(IllegalStateException.class::isInstance),
-      Mono.empty()
-          .as(StepVerifier::create)
-          .verifyErrorSatisfies(t -> assertThat(t).isInstanceOf(AssertionError.class)));
+      Mono.empty().as(StepVerifier::create).verifyError(IllegalArgumentException.class),
+      Mono.empty().as(StepVerifier::create).verifyError(IllegalStateException.class),
+      Mono.empty().as(StepVerifier::create).verifyError(AssertionError.class));
 }

LastStepVerifyErrorMatches

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyErrorMatches") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyErrorMatches).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<?> testLastStepVerifyErrorMatches() {
   return ImmutableSet.of(
       Mono.empty()
           .as(StepVerifier::create)
-          .expectErrorMatches(IllegalArgumentException.class::equals)
-          .verify(),
+          .verifyErrorMatches(IllegalArgumentException.class::equals),
       Mono.empty()
           .as(StepVerifier::create)
-          .expectError()
-          .verifyThenAssertThat()
-          .hasOperatorErrorMatching(IllegalStateException.class::equals));
+          .verifyErrorMatches(IllegalStateException.class::equals));
 }

LastStepVerifyErrorSatisfies

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyErrorSatisfies") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyErrorSatisfies).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Duration testLastStepVerifyErrorSatisfies() {
-  return Mono.empty().as(StepVerifier::create).expectErrorSatisfies(t -> {}).verify();
+  return Mono.empty().as(StepVerifier::create).verifyErrorSatisfies(t -> {});
 }

LastStepVerifyErrorSatisfiesAssertThatIsInstanceOfHasMessage

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyErrorSatisfiesAssertThatIsInstanceOfHasMessage") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyErrorSatisfiesAssertThatIsInstanceOfHasMessage).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<?> testLastStepVerifyErrorSatisfiesAssertThatIsInstanceOfHasMessage() {
   return ImmutableSet.of(
       Mono.empty()
           .as(StepVerifier::create)
-          .expectError()
-          .verifyThenAssertThat()
-          .hasOperatorErrorOfType(IllegalArgumentException.class)
-          .hasOperatorErrorWithMessage("foo"),
+          .verifyErrorSatisfies(
+              t -> assertThat(t).isInstanceOf(IllegalArgumentException.class).hasMessage("foo")),
       Mono.empty()
           .as(StepVerifier::create)
-          .expectError(IllegalStateException.class)
-          .verifyThenAssertThat()
-          .hasOperatorErrorWithMessage("bar"),
+          .verifyErrorSatisfies(
+              t -> assertThat(t).isInstanceOf(IllegalStateException.class).hasMessage("bar")),
       Mono.empty()
           .as(StepVerifier::create)
-          .expectErrorMessage("baz")
-          .verifyThenAssertThat()
-          .hasOperatorErrorOfType(AssertionError.class));
+          .verifyErrorSatisfies(
+              t -> assertThat(t).isInstanceOf(AssertionError.class).hasMessage("baz")));
 }

LastStepVerifyErrorMessage

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyErrorMessage") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyErrorMessage).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Duration testLastStepVerifyErrorMessage() {
-  return Mono.empty().as(StepVerifier::create).expectErrorMessage("foo").verify();
+  return Mono.empty().as(StepVerifier::create).verifyErrorMessage("foo");
 }

LastStepVerifyTimeout

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("LastStepVerifyTimeout") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$LastStepVerifyTimeout).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Duration testLastStepVerifyTimeout() {
-  return Mono.empty().as(StepVerifier::create).expectTimeout(Duration.ZERO).verify();
+  return Mono.empty().as(StepVerifier::create).verifyTimeout(Duration.ZERO);
 }

MonoFromFuture

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFromFuture") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFromFuture).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Void> testMonoFromFuture() {
-  return Mono.fromFuture(CompletableFuture.completedFuture(null));
+  return Mono.fromFuture(() -> CompletableFuture.completedFuture(null));
 }

MonoFromFutureWithBoolean

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFromFutureWithBoolean") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFromFutureWithBoolean).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Void> testMonoFromFutureWithBoolean() {
-  return Mono.fromFuture(CompletableFuture.completedFuture(null), true);
+  return Mono.fromFuture(() -> CompletableFuture.completedFuture(null), true);
 }

MonoFromFutureAsyncLoadingCacheGetTrue

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFromFutureAsyncLoadingCacheGetTrue") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFromFutureAsyncLoadingCacheGetTrue).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<String> testMonoFromFutureAsyncLoadingCacheGetTrue() {
-  return Mono.fromFuture(() -> ((AsyncLoadingCache<Integer, String>) null).get(0));
+  return Mono.fromFuture(() -> ((AsyncLoadingCache<Integer, String>) null).get(0), true);
 }

MonoFromFutureAsyncLoadingCacheGetAllTrue

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("MonoFromFutureAsyncLoadingCacheGetAllTrue") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$MonoFromFutureAsyncLoadingCacheGetAllTrue).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<Map<Integer, String>> testMonoFromFutureAsyncLoadingCacheGetAllTrue() {
   return Mono.fromFuture(
-      () -> ((AsyncLoadingCache<Integer, String>) null).getAll(ImmutableSet.of()));
+      () -> ((AsyncLoadingCache<Integer, String>) null).getAll(ImmutableSet.of()), true);
 }

FluxFromStream

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxFromStream") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxFromStream).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Flux<Integer> testFluxFromStream() {
-  return Flux.fromStream(Stream.of(1));
+  return Flux.fromStream(() -> Stream.of(1));
 }

FluxNext

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("FluxNext") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!ReactorRules\$FluxNext).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 Mono<String> testFluxNext() {
-  return Mono.from(Flux.just("foo"));
+  return Flux.just("foo").next();
 }

Copyright © 2017-2026 Picnic Technologies BV