File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
main/java/rx/subscriptions
test/java/rx/subscriptions Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ State remove(Subscription s) {
72
72
for (Subscription _s : subscriptions ) {
73
73
if (!_s .equals (s )) {
74
74
// was not in this composite
75
- if (idx == subscriptions .length ) {
75
+ if (idx == newSubscriptions .length ) {
76
76
return this ;
77
77
}
78
78
newSubscriptions [idx ] = _s ;
Original file line number Diff line number Diff line change @@ -324,4 +324,17 @@ public void run() {
324
324
// we should have only unsubscribed once
325
325
assertEquals (1 , counter .get ());
326
326
}
327
+ @ Test
328
+ public void testTryRemoveIfNotIn () {
329
+ CompositeSubscription csub = new CompositeSubscription ();
330
+
331
+ CompositeSubscription csub1 = new CompositeSubscription ();
332
+ CompositeSubscription csub2 = new CompositeSubscription ();
333
+
334
+ csub .add (csub1 );
335
+ csub .remove (csub1 );
336
+ csub .add (csub2 );
337
+
338
+ csub .remove (csub1 ); // try removing agian
339
+ }
327
340
}
You can’t perform that action at this time.
0 commit comments