.class public final Lio/reactivex/disposables/CompositeDisposable; .super Ljava/lang/Object; .source "CompositeDisposable.java" # interfaces .implements Lio/reactivex/disposables/Disposable; .implements Lio/reactivex/internal/disposables/DisposableContainer; # instance fields .field volatile disposed:Z .field resources:Lio/reactivex/internal/util/OpenHashSet; .annotation system Ldalvik/annotation/Signature; value = { "Lio/reactivex/internal/util/OpenHashSet<", "Lio/reactivex/disposables/Disposable;", ">;" } .end annotation .end field # direct methods .method public constructor ()V .locals 0 .line 35 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public constructor (Ljava/lang/Iterable;)V .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Iterable<", "+", "Lio/reactivex/disposables/Disposable;", ">;)V" } .end annotation .line 55 invoke-direct {p0}, Ljava/lang/Object;->()V const-string v0, "resources is null" .line 56 invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 57 new-instance v0, Lio/reactivex/internal/util/OpenHashSet; invoke-direct {v0}, Lio/reactivex/internal/util/OpenHashSet;->()V iput-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; .line 58 invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object p1 :goto_0 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result v0 if-eqz v0, :cond_0 invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Lio/reactivex/disposables/Disposable; const-string v1, "Disposable item is null" .line 59 invoke-static {v0, v1}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 60 iget-object v1, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; invoke-virtual {v1, v0}, Lio/reactivex/internal/util/OpenHashSet;->add(Ljava/lang/Object;)Z goto :goto_0 :cond_0 return-void .end method .method public varargs constructor ([Lio/reactivex/disposables/Disposable;)V .locals 4 .line 42 invoke-direct {p0}, Ljava/lang/Object;->()V const-string v0, "resources is null" .line 43 invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 44 new-instance v0, Lio/reactivex/internal/util/OpenHashSet; array-length v1, p1 add-int/lit8 v1, v1, 0x1 invoke-direct {v0, v1}, Lio/reactivex/internal/util/OpenHashSet;->(I)V iput-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; .line 45 array-length v0, p1 const/4 v1, 0x0 :goto_0 if-ge v1, v0, :cond_0 aget-object v2, p1, v1 const-string v3, "Disposable item is null" .line 46 invoke-static {v2, v3}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 47 iget-object v3, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; invoke-virtual {v3, v2}, Lio/reactivex/internal/util/OpenHashSet;->add(Ljava/lang/Object;)Z add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_0 return-void .end method # virtual methods .method public add(Lio/reactivex/disposables/Disposable;)Z .locals 1 const-string v0, "d is null" .line 89 invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 90 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-nez v0, :cond_2 .line 91 monitor-enter p0 .line 92 :try_start_0 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-nez v0, :cond_1 .line 93 iget-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; if-nez v0, :cond_0 .line 95 new-instance v0, Lio/reactivex/internal/util/OpenHashSet; invoke-direct {v0}, Lio/reactivex/internal/util/OpenHashSet;->()V .line 96 iput-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; .line 98 :cond_0 invoke-virtual {v0, p1}, Lio/reactivex/internal/util/OpenHashSet;->add(Ljava/lang/Object;)Z const/4 p1, 0x1 .line 99 monitor-exit p0 return p1 .line 101 :cond_1 monitor-exit p0 goto :goto_0 :catchall_0 move-exception p1 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p1 .line 103 :cond_2 :goto_0 invoke-interface {p1}, Lio/reactivex/disposables/Disposable;->dispose()V const/4 p1, 0x0 return p1 .end method .method public varargs addAll([Lio/reactivex/disposables/Disposable;)Z .locals 6 const-string v0, "ds is null" .line 114 invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 115 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z const/4 v1, 0x0 if-nez v0, :cond_3 .line 116 monitor-enter p0 .line 117 :try_start_0 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-nez v0, :cond_2 .line 118 iget-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; const/4 v2, 0x1 if-nez v0, :cond_0 .line 120 new-instance v0, Lio/reactivex/internal/util/OpenHashSet; array-length v3, p1 add-int/2addr v3, v2 invoke-direct {v0, v3}, Lio/reactivex/internal/util/OpenHashSet;->(I)V .line 121 iput-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; .line 123 :cond_0 array-length v3, p1 :goto_0 if-ge v1, v3, :cond_1 aget-object v4, p1, v1 const-string v5, "d is null" .line 124 invoke-static {v4, v5}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 125 invoke-virtual {v0, v4}, Lio/reactivex/internal/util/OpenHashSet;->add(Ljava/lang/Object;)Z add-int/lit8 v1, v1, 0x1 goto :goto_0 .line 127 :cond_1 monitor-exit p0 return v2 .line 129 :cond_2 monitor-exit p0 goto :goto_1 :catchall_0 move-exception p1 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p1 .line 131 :cond_3 :goto_1 array-length v0, p1 const/4 v2, 0x0 :goto_2 if-ge v2, v0, :cond_4 aget-object v3, p1, v2 .line 132 invoke-interface {v3}, Lio/reactivex/disposables/Disposable;->dispose()V add-int/lit8 v2, v2, 0x1 goto :goto_2 :cond_4 return v1 .end method .method public clear()V .locals 2 .line 169 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-eqz v0, :cond_0 return-void .line 173 :cond_0 monitor-enter p0 .line 174 :try_start_0 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-eqz v0, :cond_1 .line 175 monitor-exit p0 return-void .line 178 :cond_1 iget-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; const/4 v1, 0x0 .line 179 iput-object v1, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; .line 180 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 182 invoke-virtual {p0, v0}, Lio/reactivex/disposables/CompositeDisposable;->dispose(Lio/reactivex/internal/util/OpenHashSet;)V return-void :catchall_0 move-exception v0 .line 180 :try_start_1 monitor-exit p0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw v0 .end method .method public delete(Lio/reactivex/disposables/Disposable;)Z .locals 2 const-string v0, "Disposable item is null" .line 148 invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 149 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z const/4 v1, 0x0 if-eqz v0, :cond_0 return v1 .line 152 :cond_0 monitor-enter p0 .line 153 :try_start_0 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-eqz v0, :cond_1 .line 154 monitor-exit p0 return v1 .line 157 :cond_1 iget-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; if-eqz v0, :cond_3 .line 158 invoke-virtual {v0, p1}, Lio/reactivex/internal/util/OpenHashSet;->remove(Ljava/lang/Object;)Z move-result p1 if-nez p1, :cond_2 goto :goto_0 .line 161 :cond_2 monitor-exit p0 const/4 p1, 0x1 return p1 .line 159 :cond_3 :goto_0 monitor-exit p0 return v1 :catchall_0 move-exception p1 .line 161 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p1 .end method .method public dispose()V .locals 2 .line 66 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-eqz v0, :cond_0 return-void .line 70 :cond_0 monitor-enter p0 .line 71 :try_start_0 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-eqz v0, :cond_1 .line 72 monitor-exit p0 return-void :cond_1 const/4 v0, 0x1 .line 74 iput-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z .line 75 iget-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; const/4 v1, 0x0 .line 76 iput-object v1, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; .line 77 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 79 invoke-virtual {p0, v0}, Lio/reactivex/disposables/CompositeDisposable;->dispose(Lio/reactivex/internal/util/OpenHashSet;)V return-void :catchall_0 move-exception v0 .line 77 :try_start_1 monitor-exit p0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw v0 .end method .method dispose(Lio/reactivex/internal/util/OpenHashSet;)V .locals 6 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lio/reactivex/internal/util/OpenHashSet<", "Lio/reactivex/disposables/Disposable;", ">;)V" } .end annotation if-nez p1, :cond_0 return-void :cond_0 const/4 v0, 0x0 .line 212 invoke-virtual {p1}, Lio/reactivex/internal/util/OpenHashSet;->keys()[Ljava/lang/Object; move-result-object p1 .line 213 array-length v1, p1 const/4 v2, 0x0 move-object v3, v0 const/4 v0, 0x0 :goto_0 if-ge v0, v1, :cond_3 aget-object v4, p1, v0 .line 214 instance-of v5, v4, Lio/reactivex/disposables/Disposable; if-eqz v5, :cond_2 .line 216 :try_start_0 check-cast v4, Lio/reactivex/disposables/Disposable; invoke-interface {v4}, Lio/reactivex/disposables/Disposable;->dispose()V :try_end_0 .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_1 :catch_0 move-exception v4 .line 218 invoke-static {v4}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V if-nez v3, :cond_1 .line 220 new-instance v3, Ljava/util/ArrayList; invoke-direct {v3}, Ljava/util/ArrayList;->()V .line 222 :cond_1 invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z :cond_2 :goto_1 add-int/lit8 v0, v0, 0x1 goto :goto_0 :cond_3 if-eqz v3, :cond_5 .line 227 invoke-interface {v3}, Ljava/util/List;->size()I move-result p1 const/4 v0, 0x1 if-ne p1, v0, :cond_4 .line 228 invoke-interface {v3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object p1 check-cast p1, Ljava/lang/Throwable; invoke-static {p1}, Lio/reactivex/internal/util/ExceptionHelper;->wrapOrThrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; move-result-object p1 throw p1 .line 230 :cond_4 new-instance p1, Lio/reactivex/exceptions/CompositeException; invoke-direct {p1, v3}, Lio/reactivex/exceptions/CompositeException;->(Ljava/lang/Iterable;)V throw p1 :cond_5 return-void .end method .method public isDisposed()Z .locals 1 .line 84 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z return v0 .end method .method public remove(Lio/reactivex/disposables/Disposable;)Z .locals 1 .line 139 invoke-virtual {p0, p1}, Lio/reactivex/disposables/CompositeDisposable;->delete(Lio/reactivex/disposables/Disposable;)Z move-result v0 if-eqz v0, :cond_0 .line 140 invoke-interface {p1}, Lio/reactivex/disposables/Disposable;->dispose()V const/4 p1, 0x1 return p1 :cond_0 const/4 p1, 0x0 return p1 .end method .method public size()I .locals 2 .line 190 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z const/4 v1, 0x0 if-eqz v0, :cond_0 return v1 .line 193 :cond_0 monitor-enter p0 .line 194 :try_start_0 iget-boolean v0, p0, Lio/reactivex/disposables/CompositeDisposable;->disposed:Z if-eqz v0, :cond_1 .line 195 monitor-exit p0 return v1 .line 197 :cond_1 iget-object v0, p0, Lio/reactivex/disposables/CompositeDisposable;->resources:Lio/reactivex/internal/util/OpenHashSet; if-eqz v0, :cond_2 .line 198 invoke-virtual {v0}, Lio/reactivex/internal/util/OpenHashSet;->size()I move-result v1 :cond_2 monitor-exit p0 return v1 :catchall_0 move-exception v0 .line 199 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw v0 .end method