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) {
7272 for (Subscription _s : subscriptions ) {
7373 if (!_s .equals (s )) {
7474 // was not in this composite
75- if (idx == subscriptions .length ) {
75+ if (idx == newSubscriptions .length ) {
7676 return this ;
7777 }
7878 newSubscriptions [idx ] = _s ;
Original file line number Diff line number Diff line change @@ -324,4 +324,17 @@ public void run() {
324324 // we should have only unsubscribed once
325325 assertEquals (1 , counter .get ());
326326 }
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+ }
327340}
You can’t perform that action at this time.
0 commit comments