diff --git a/src/main/java/io/reactivex/processors/AsyncProcessor.java b/src/main/java/io/reactivex/processors/AsyncProcessor.java
index e360d17eb3..3cce2ee466 100644
--- a/src/main/java/io/reactivex/processors/AsyncProcessor.java
+++ b/src/main/java/io/reactivex/processors/AsyncProcessor.java
@@ -12,7 +12,6 @@
*/
package io.reactivex.processors;
-import java.util.Arrays;
import java.util.concurrent.atomic.AtomicReference;
import org.reactivestreams.*;
@@ -63,7 +62,7 @@
* This {@code AsyncProcessor} supports the standard state-peeking methods {@link #hasComplete()}, {@link #hasThrowable()},
* {@link #getThrowable()} and {@link #hasSubscribers()} as well as means to read the very last observed value -
* after this {@code AsyncProcessor} has been completed - in a non-blocking and thread-safe
- * manner via {@link #hasValue()}, {@link #getValue()}, {@link #getValues()} or {@link #getValues(Object[])}.
+ * manner via {@link #hasValue()} or {@link #getValue()}.
*
*
Backpressure:
*
The {@code AsyncProcessor} honors the backpressure of the downstream {@code Subscriber}s and won't emit
@@ -331,46 +330,6 @@ public T getValue() {
return subscribers.get() == TERMINATED ? value : null;
}
- /**
- * Returns an Object array containing snapshot all values of this processor.
- *
The method is thread-safe.
- * @return the array containing the snapshot of all values of this processor
- * @deprecated in 2.1.14; put the result of {@link #getValue()} into an array manually, will be removed in 3.x
- */
- @Deprecated
- public Object[] getValues() {
- T v = getValue();
- return v != null ? new Object[] { v } : new Object[0];
- }
-
- /**
- * Returns a typed array containing a snapshot of all values of this processor.
- *
The method follows the conventions of Collection.toArray by setting the array element
- * after the last value to null (if the capacity permits).
- *
The method is thread-safe.
- * @param array the target array to copy values into if it fits
- * @return the given array if the values fit into it or a new array containing all values
- * @deprecated in 2.1.14; put the result of {@link #getValue()} into an array manually, will be removed in 3.x
- */
- @Deprecated
- public T[] getValues(T[] array) {
- T v = getValue();
- if (v == null) {
- if (array.length != 0) {
- array[0] = null;
- }
- return array;
- }
- if (array.length == 0) {
- array = Arrays.copyOf(array, 1);
- }
- array[0] = v;
- if (array.length != 1) {
- array[1] = null;
- }
- return array;
- }
-
static final class AsyncSubscription extends DeferredScalarSubscription {
private static final long serialVersionUID = 5629876084736248016L;
diff --git a/src/main/java/io/reactivex/processors/BehaviorProcessor.java b/src/main/java/io/reactivex/processors/BehaviorProcessor.java
index a81c51085e..74ef0041eb 100644
--- a/src/main/java/io/reactivex/processors/BehaviorProcessor.java
+++ b/src/main/java/io/reactivex/processors/BehaviorProcessor.java
@@ -13,7 +13,6 @@
package io.reactivex.processors;
-import java.lang.reflect.Array;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
@@ -95,8 +94,7 @@
*
* This {@code BehaviorProcessor} supports the standard state-peeking methods {@link #hasComplete()}, {@link #hasThrowable()},
* {@link #getThrowable()} and {@link #hasSubscribers()} as well as means to read the latest observed value
- * in a non-blocking and thread-safe manner via {@link #hasValue()}, {@link #getValue()},
- * {@link #getValues()} or {@link #getValues(Object[])}.
+ * in a non-blocking and thread-safe manner via {@link #hasValue()} or {@link #getValue()}.
*
* Note that this processor signals {@code MissingBackpressureException} if a particular {@code Subscriber} is not
* ready to receive {@code onNext} events. To avoid this exception being signaled, use {@link #offer(Object)} to only
@@ -374,56 +372,6 @@ public T getValue() {
return NotificationLite.getValue(o);
}
- /**
- * Returns an Object array containing snapshot all values of the BehaviorProcessor.
- *
The method is thread-safe.
- * @return the array containing the snapshot of all values of the BehaviorProcessor
- * @deprecated in 2.1.14; put the result of {@link #getValue()} into an array manually, will be removed in 3.x
- */
- @Deprecated
- public Object[] getValues() {
- @SuppressWarnings("unchecked")
- T[] a = (T[])EMPTY_ARRAY;
- T[] b = getValues(a);
- if (b == EMPTY_ARRAY) {
- return new Object[0];
- }
- return b;
-
- }
-
- /**
- * Returns a typed array containing a snapshot of all values of the BehaviorProcessor.
- *
The method follows the conventions of Collection.toArray by setting the array element
- * after the last value to null (if the capacity permits).
- *
The method is thread-safe.
- * @param array the target array to copy values into if it fits
- * @return the given array if the values fit into it or a new array containing all values
- * @deprecated in 2.1.14; put the result of {@link #getValue()} into an array manually, will be removed in 3.x
- */
- @Deprecated
- @SuppressWarnings("unchecked")
- public T[] getValues(T[] array) {
- Object o = value.get();
- if (o == null || NotificationLite.isComplete(o) || NotificationLite.isError(o)) {
- if (array.length != 0) {
- array[0] = null;
- }
- return array;
- }
- T v = NotificationLite.getValue(o);
- if (array.length != 0) {
- array[0] = v;
- if (array.length != 1) {
- array[1] = null;
- }
- } else {
- array = (T[])Array.newInstance(array.getClass().getComponentType(), 1);
- array[0] = v;
- }
- return array;
- }
-
@Override
public boolean hasComplete() {
Object o = value.get();
diff --git a/src/main/java/io/reactivex/subjects/AsyncSubject.java b/src/main/java/io/reactivex/subjects/AsyncSubject.java
index ce9b2dcedb..6bc006393d 100644
--- a/src/main/java/io/reactivex/subjects/AsyncSubject.java
+++ b/src/main/java/io/reactivex/subjects/AsyncSubject.java
@@ -13,13 +13,10 @@
package io.reactivex.subjects;
-import io.reactivex.annotations.Nullable;
-import io.reactivex.annotations.NonNull;
-import java.util.Arrays;
import java.util.concurrent.atomic.AtomicReference;
import io.reactivex.Observer;
-import io.reactivex.annotations.CheckReturnValue;
+import io.reactivex.annotations.*;
import io.reactivex.disposables.Disposable;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.observers.DeferredScalarDisposable;
@@ -64,7 +61,7 @@
* This {@code AsyncSubject} supports the standard state-peeking methods {@link #hasComplete()}, {@link #hasThrowable()},
* {@link #getThrowable()} and {@link #hasObservers()} as well as means to read the very last observed value -
* after this {@code AsyncSubject} has been completed - in a non-blocking and thread-safe
- * manner via {@link #hasValue()}, {@link #getValue()}, {@link #getValues()} or {@link #getValues(Object[])}.
+ * manner via {@link #hasValue()} or {@link #getValue()}.
*
*
Scheduler:
*
{@code AsyncSubject} does not operate by default on a particular {@link io.reactivex.Scheduler} and
@@ -321,46 +318,6 @@ public T getValue() {
return subscribers.get() == TERMINATED ? value : null;
}
- /**
- * Returns an Object array containing snapshot all values of the Subject.
- *
The method is thread-safe.
- * @return the array containing the snapshot of all values of the Subject
- * @deprecated in 2.1.14; put the result of {@link #getValue()} into an array manually, will be removed in 3.x
- */
- @Deprecated
- public Object[] getValues() {
- T v = getValue();
- return v != null ? new Object[] { v } : new Object[0];
- }
-
- /**
- * Returns a typed array containing a snapshot of all values of the Subject.
- *
The method follows the conventions of Collection.toArray by setting the array element
- * after the last value to null (if the capacity permits).
- *
The method is thread-safe.
- * @param array the target array to copy values into if it fits
- * @return the given array if the values fit into it or a new array containing all values
- * @deprecated in 2.1.14; put the result of {@link #getValue()} into an array manually, will be removed in 3.x
- */
- @Deprecated
- public T[] getValues(T[] array) {
- T v = getValue();
- if (v == null) {
- if (array.length != 0) {
- array[0] = null;
- }
- return array;
- }
- if (array.length == 0) {
- array = Arrays.copyOf(array, 1);
- }
- array[0] = v;
- if (array.length != 1) {
- array[1] = null;
- }
- return array;
- }
-
static final class AsyncDisposable extends DeferredScalarDisposable {
private static final long serialVersionUID = 5629876084736248016L;
diff --git a/src/main/java/io/reactivex/subjects/BehaviorSubject.java b/src/main/java/io/reactivex/subjects/BehaviorSubject.java
index c58cb40779..417ea310b0 100644
--- a/src/main/java/io/reactivex/subjects/BehaviorSubject.java
+++ b/src/main/java/io/reactivex/subjects/BehaviorSubject.java
@@ -13,14 +13,11 @@
package io.reactivex.subjects;
-import io.reactivex.annotations.CheckReturnValue;
-import io.reactivex.annotations.Nullable;
-import io.reactivex.annotations.NonNull;
-import java.lang.reflect.Array;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.*;
import io.reactivex.Observer;
+import io.reactivex.annotations.*;
import io.reactivex.disposables.Disposable;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.util.*;
@@ -97,8 +94,7 @@
*
* This {@code BehaviorSubject} supports the standard state-peeking methods {@link #hasComplete()}, {@link #hasThrowable()},
* {@link #getThrowable()} and {@link #hasObservers()} as well as means to read the latest observed value
- * in a non-blocking and thread-safe manner via {@link #hasValue()}, {@link #getValue()},
- * {@link #getValues()} or {@link #getValues(Object[])}.
+ * in a non-blocking and thread-safe manner via {@link #hasValue()} or {@link #getValue()}.
*
*
Scheduler:
*
{@code BehaviorSubject} does not operate by default on a particular {@link io.reactivex.Scheduler} and
@@ -153,9 +149,6 @@
*/
public final class BehaviorSubject extends Subject {
- /** An empty array to avoid allocation in getValues(). */
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
final AtomicReference