File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
rxjava-core/src/main/java/rx/internal/operators Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,22 @@ public void onStart() {
55
55
public void onCompleted () {
56
56
try {
57
57
completed = true ;
58
- o .onNext (Collections .unmodifiableList (list ));
58
+ /*
59
+ * Ideally this should just return Collections.unmodifiableList(list) and not copy it,
60
+ * but, it ends up being a breaking change if we make that modification.
61
+ *
62
+ * Here is an example of is being done with these lists that breaks if we make it immutable:
63
+ *
64
+ * Caused by: java.lang.UnsupportedOperationException
65
+ * at java.util.Collections$UnmodifiableList$1.set(Collections.java:1244)
66
+ * at java.util.Collections.sort(Collections.java:221)
67
+ * ...
68
+ * Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: UnmodifiableList.class
69
+ * at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)
70
+ * at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:56)
71
+ * ... 419 more
72
+ */
73
+ o .onNext (new ArrayList <T >(list ));
59
74
o .onCompleted ();
60
75
} catch (Throwable e ) {
61
76
onError (e );
You can’t perform that action at this time.
0 commit comments