@@ -8740,6 +8740,13 @@ public final <K> Flowable<T> distinct(Function<? super T, K> keySelector,
87408740 * <p>
87418741 * Note that the operator always retains the latest item from upstream regardless of the comparison result
87428742 * and uses it in the next comparison with the next upstream item.
8743+ * <p>
8744+ * Note that if element type {@code T} in the flow is mutable, the comparison of the previous and current
8745+ * item may yield unexpected results if the items are mutated externally. Common cases are mutable
8746+ * {@code CharSequence}s or {@code List}s where the objects will actually have the same
8747+ * references when they are modified and {@code distinctUntilChanged} will evaluate subsequent items as same.
8748+ * To avoid such situation, it is recommended that mutable data is converted to an immutable one,
8749+ * for example using `map(CharSequence::toString)` or `map(Collections::unmodifiableList)`.
87438750 * <dl>
87448751 * <dt><b>Backpressure:</b></dt>
87458752 * <dd>The operator doesn't interfere with backpressure which is determined by the source {@code Publisher}'s
@@ -8776,6 +8783,13 @@ public final Flowable<T> distinctUntilChanged() {
87768783 * <p>
87778784 * Note that the operator always retains the latest key from upstream regardless of the comparison result
87788785 * and uses it in the next comparison with the next key derived from the next upstream item.
8786+ * <p>
8787+ * Note that if element type {@code T} in the flow is mutable, the comparison of the previous and current
8788+ * item may yield unexpected results if the items are mutated externally. Common cases are mutable
8789+ * {@code CharSequence}s or {@code List}s where the objects will actually have the same
8790+ * references when they are modified and {@code distinctUntilChanged} will evaluate subsequent items as same.
8791+ * To avoid such situation, it is recommended that mutable data is converted to an immutable one,
8792+ * for example using `map(CharSequence::toString)` or `map(Collections::unmodifiableList)`.
87798793 * <dl>
87808794 * <dt><b>Backpressure:</b></dt>
87818795 * <dd>The operator doesn't interfere with backpressure which is determined by the source {@code Publisher}'s
@@ -8808,6 +8822,13 @@ public final <K> Flowable<T> distinctUntilChanged(Function<? super T, K> keySele
88088822 * <p>
88098823 * Note that the operator always retains the latest item from upstream regardless of the comparison result
88108824 * and uses it in the next comparison with the next upstream item.
8825+ * <p>
8826+ * Note that if element type {@code T} in the flow is mutable, the comparison of the previous and current
8827+ * item may yield unexpected results if the items are mutated externally. Common cases are mutable
8828+ * {@code CharSequence}s or {@code List}s where the objects will actually have the same
8829+ * references when they are modified and {@code distinctUntilChanged} will evaluate subsequent items as same.
8830+ * To avoid such situation, it is recommended that mutable data is converted to an immutable one,
8831+ * for example using `map(CharSequence::toString)` or `map(Collections::unmodifiableList)`.
88118832 * <dl>
88128833 * <dt><b>Backpressure:</b></dt>
88138834 * <dd>The operator doesn't interfere with backpressure which is determined by the source {@code Publisher}'s
0 commit comments