From 9cb537a4f64ad54625c2a03410882c1e12e3c0e1 Mon Sep 17 00:00:00 2001 From: Phil Werli Date: Thu, 4 Jan 2024 19:02:32 +0100 Subject: [PATCH] Is this notiation prefered? --- .../tech/picnic/errorprone/refasterrules/OptionalRules.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java index 2f0607d536a..1491b18eac9 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java @@ -388,8 +388,7 @@ static final class OptionalIdentity { @BeforeTemplate Optional before(Optional optional, Comparator comparator) { return Refaster.anyOf( - optional.or(() -> Optional.empty()), - optional.or(Optional::empty), + optional.or(Refaster.anyOf(() -> Optional.empty(), Optional::empty)), optional.stream().findFirst(), optional.stream().findAny(), optional.stream().min(comparator),