From 20bc4b61ae586c4075527558bf1a85bd8d1a3175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Mon, 14 Apr 2025 18:12:23 +0200 Subject: [PATCH] Observable javadoc: the condition is inverted between takeWhile and takeUntil. The current description of the difference between takeWhile and takeUntil just points to the evaluation time (before or after the element is emitted), but the (IMHO) more important fact is that the predicate is inverted between both: one emits just elements where the predicate is true, the other just elements where the predicate is false (and the first true one). --- src/main/java/io/reactivex/rxjava3/core/Observable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/reactivex/rxjava3/core/Observable.java b/src/main/java/io/reactivex/rxjava3/core/Observable.java index fcf809cdf6..459d24a141 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Observable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Observable.java @@ -14147,7 +14147,7 @@ public final Observable takeLast(long time, @NonNull TimeUnit unit, @NonNull * *

* The difference between this operator and {@link #takeWhile(Predicate)} is that here, the condition is - * evaluated after the item is emitted. + * evaluated after the item is emitted. (Also, the condition is inverted.) * *

*
Scheduler: