From 7a48184fa1c94491529c3ce5cd09ad77a998a3be Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sun, 22 Jan 2023 16:47:04 +0100 Subject: [PATCH] Document `MonoFlatMapToFlux` Refaster rule limitation --- .../tech/picnic/errorprone/refasterrules/ReactorRules.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java index 6c49792fb8..a19cfd2327 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java @@ -474,6 +474,11 @@ Flux after( * Flux}. */ abstract static class MonoFlatMapToFlux { + // XXX: I'd be more expressive if this `@Placeholder` were replaced with a `Function>` parameter, so that compatible non-lambda expression arguments + // to `flatMapMany` are also matched. However, the type inferred for lambda and method reference + // expressions passed to `flatMapMany` appears to always be `Function>`, which doesn't match. Find a solution. @Placeholder(allowsIdentity = true) abstract Mono transformation(@MayOptionallyUse T value);