@@ -75,6 +75,20 @@ public final Thread lastThread() {
75
75
76
76
/**
77
77
* Returns a shared list of received onNext values.
78
+ * <p>
79
+ * Note that accessing the items via certain methods of the {@link List}
80
+ * interface while the upstream is still actively emitting
81
+ * more items may result in a {@code ConcurrentModificationException}.
82
+ * <p>
83
+ * The {@link List#size()} method will return the number of items
84
+ * already received by this TestObserver/TestSubscriber in a thread-safe
85
+ * manner that can be read via {@link List#get(int)}) method
86
+ * (index range of 0 to {@code List.size() - 1}).
87
+ * <p>
88
+ * A view of the returned List can be created via {@link List#subList(int, int)}
89
+ * by using the bounds 0 (inclusive) to {@link List#size()} (exclusive) which,
90
+ * when accessed in a read-only fashion, should be also thread-safe and not throw any
91
+ * {@code ConcurrentModificationException}.
78
92
* @return a list of received onNext values
79
93
*/
80
94
public final List <T > values () {
@@ -83,6 +97,20 @@ public final List<T> values() {
83
97
84
98
/**
85
99
* Returns a shared list of received onError exceptions.
100
+ * <p>
101
+ * Note that accessing the errors via certain methods of the {@link List}
102
+ * interface while the upstream is still actively emitting
103
+ * more items or errors may result in a {@code ConcurrentModificationException}.
104
+ * <p>
105
+ * The {@link List#size()} method will return the number of errors
106
+ * already received by this TestObserver/TestSubscriber in a thread-safe
107
+ * manner that can be read via {@link List#get(int)}) method
108
+ * (index range of 0 to {@code List.size() - 1}).
109
+ * <p>
110
+ * A view of the returned List can be created via {@link List#subList(int, int)}
111
+ * by using the bounds 0 (inclusive) to {@link List#size()} (exclusive) which,
112
+ * when accessed in a read-only fashion, should be also thread-safe and not throw any
113
+ * {@code ConcurrentModificationException}.
86
114
* @return a list of received events onError exceptions
87
115
*/
88
116
public final List <Throwable > errors () {
0 commit comments