From 3a94aad3b0f60006fd7f4c71f7a64c18ae88b582 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Tue, 24 Jan 2023 15:38:52 +0100 Subject: [PATCH] Document `MonoFlatMapToFlux` Refaster rule limitation (#473) --- .../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..c99c77482a 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: It would 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);