.class public final Lio/reactivex/subscribers/SerializedSubscriber; .super Ljava/lang/Object; .source "SerializedSubscriber.java" # interfaces .implements Lorg/reactivestreams/Subscriber; .implements Lorg/reactivestreams/Subscription; # annotations .annotation system Ldalvik/annotation/Signature; value = { "", "Ljava/lang/Object;", "Lorg/reactivestreams/Subscriber<", "TT;>;", "Lorg/reactivestreams/Subscription;" } .end annotation # static fields .field static final QUEUE_LINK_SIZE:I = 0x4 # instance fields .field final actual:Lorg/reactivestreams/Subscriber; .annotation system Ldalvik/annotation/Signature; value = { "Lorg/reactivestreams/Subscriber<", "-TT;>;" } .end annotation .end field .field final delayError:Z .field volatile done:Z .field emitting:Z .field queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; .annotation system Ldalvik/annotation/Signature; value = { "Lio/reactivex/internal/util/AppendOnlyLinkedArrayList<", "Ljava/lang/Object;", ">;" } .end annotation .end field .field subscription:Lorg/reactivestreams/Subscription; # direct methods .method public constructor (Lorg/reactivestreams/Subscriber;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lorg/reactivestreams/Subscriber<", "-TT;>;)V" } .end annotation const/4 v0, 0x0 .line 49 invoke-direct {p0, p1, v0}, Lio/reactivex/subscribers/SerializedSubscriber;->(Lorg/reactivestreams/Subscriber;Z)V return-void .end method .method public constructor (Lorg/reactivestreams/Subscriber;Z)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lorg/reactivestreams/Subscriber<", "-TT;>;Z)V" } .end annotation .line 59 invoke-direct {p0}, Ljava/lang/Object;->()V .line 60 iput-object p1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->actual:Lorg/reactivestreams/Subscriber; .line 61 iput-boolean p2, p0, Lio/reactivex/subscribers/SerializedSubscriber;->delayError:Z return-void .end method # virtual methods .method public cancel()V .locals 1 .line 195 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->subscription:Lorg/reactivestreams/Subscription; invoke-interface {v0}, Lorg/reactivestreams/Subscription;->cancel()V return-void .end method .method emitLoop()V .locals 2 .line 173 :cond_0 monitor-enter p0 .line 174 :try_start_0 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; if-nez v0, :cond_1 const/4 v0, 0x0 .line 176 iput-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z .line 177 monitor-exit p0 return-void :cond_1 const/4 v1, 0x0 .line 179 iput-object v1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; .line 180 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 182 iget-object v1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->actual:Lorg/reactivestreams/Subscriber; invoke-virtual {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->accept(Lorg/reactivestreams/Subscriber;)Z move-result v0 if-eqz v0, :cond_0 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 goto :goto_1 :goto_0 throw v0 :goto_1 goto :goto_0 .end method .method public onComplete()V .locals 2 .line 146 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z if-eqz v0, :cond_0 return-void .line 149 :cond_0 monitor-enter p0 .line 150 :try_start_0 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z if-eqz v0, :cond_1 .line 151 monitor-exit p0 return-void .line 153 :cond_1 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z if-eqz v0, :cond_3 .line 154 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; if-nez v0, :cond_2 .line 156 new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; const/4 v1, 0x4 invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->(I)V .line 157 iput-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; .line 159 :cond_2 invoke-static {}, Lio/reactivex/internal/util/NotificationLite;->complete()Ljava/lang/Object; move-result-object v1 invoke-virtual {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V .line 160 monitor-exit p0 return-void :cond_3 const/4 v0, 0x1 .line 162 iput-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z .line 163 iput-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z .line 164 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 166 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->actual:Lorg/reactivestreams/Subscriber; invoke-interface {v0}, Lorg/reactivestreams/Subscriber;->onComplete()V return-void :catchall_0 move-exception v0 .line 164 :try_start_1 monitor-exit p0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw v0 .end method .method public onError(Ljava/lang/Throwable;)V .locals 2 .line 105 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z if-eqz v0, :cond_0 .line 106 invoke-static {p1}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V return-void .line 110 :cond_0 monitor-enter p0 .line 111 :try_start_0 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z const/4 v1, 0x1 if-eqz v0, :cond_1 goto :goto_1 .line 114 :cond_1 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z if-eqz v0, :cond_4 .line 115 iput-boolean v1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z .line 116 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; if-nez v0, :cond_2 .line 118 new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; const/4 v1, 0x4 invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->(I)V .line 119 iput-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; .line 121 :cond_2 invoke-static {p1}, Lio/reactivex/internal/util/NotificationLite;->error(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p1 .line 122 iget-boolean v1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->delayError:Z if-eqz v1, :cond_3 .line 123 invoke-virtual {v0, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V goto :goto_0 .line 125 :cond_3 invoke-virtual {v0, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->setFirst(Ljava/lang/Object;)V .line 127 :goto_0 monitor-exit p0 return-void .line 129 :cond_4 iput-boolean v1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z .line 130 iput-boolean v1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z const/4 v1, 0x0 .line 133 :goto_1 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz v1, :cond_5 .line 136 invoke-static {p1}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V return-void .line 140 :cond_5 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->actual:Lorg/reactivestreams/Subscriber; invoke-interface {v0, p1}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V return-void :catchall_0 move-exception p1 .line 133 :try_start_1 monitor-exit p0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw p1 .end method .method public onNext(Ljava/lang/Object;)V .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(TT;)V" } .end annotation .line 74 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z if-eqz v0, :cond_0 return-void :cond_0 if-nez p1, :cond_1 .line 78 iget-object p1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->subscription:Lorg/reactivestreams/Subscription; invoke-interface {p1}, Lorg/reactivestreams/Subscription;->cancel()V .line 79 new-instance p1, Ljava/lang/NullPointerException; const-string v0, "onNext called with null. Null values are generally not allowed in 2.x operators and sources." invoke-direct {p1, v0}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V invoke-virtual {p0, p1}, Lio/reactivex/subscribers/SerializedSubscriber;->onError(Ljava/lang/Throwable;)V return-void .line 82 :cond_1 monitor-enter p0 .line 83 :try_start_0 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->done:Z if-eqz v0, :cond_2 .line 84 monitor-exit p0 return-void .line 86 :cond_2 iget-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z if-eqz v0, :cond_4 .line 87 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; if-nez v0, :cond_3 .line 89 new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; const/4 v1, 0x4 invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->(I)V .line 90 iput-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList; .line 92 :cond_3 invoke-static {p1}, Lio/reactivex/internal/util/NotificationLite;->next(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 invoke-virtual {v0, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V .line 93 monitor-exit p0 return-void :cond_4 const/4 v0, 0x1 .line 95 iput-boolean v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->emitting:Z .line 96 monitor-exit p0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 98 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->actual:Lorg/reactivestreams/Subscriber; invoke-interface {v0, p1}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V .line 100 invoke-virtual {p0}, Lio/reactivex/subscribers/SerializedSubscriber;->emitLoop()V return-void :catchall_0 move-exception p1 .line 96 :try_start_1 monitor-exit p0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw p1 .end method .method public onSubscribe(Lorg/reactivestreams/Subscription;)V .locals 1 .line 66 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->subscription:Lorg/reactivestreams/Subscription; invoke-static {v0, p1}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(Lorg/reactivestreams/Subscription;Lorg/reactivestreams/Subscription;)Z move-result v0 if-eqz v0, :cond_0 .line 67 iput-object p1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->subscription:Lorg/reactivestreams/Subscription; .line 68 iget-object p1, p0, Lio/reactivex/subscribers/SerializedSubscriber;->actual:Lorg/reactivestreams/Subscriber; invoke-interface {p1, p0}, Lorg/reactivestreams/Subscriber;->onSubscribe(Lorg/reactivestreams/Subscription;)V :cond_0 return-void .end method .method public request(J)V .locals 1 .line 190 iget-object v0, p0, Lio/reactivex/subscribers/SerializedSubscriber;->subscription:Lorg/reactivestreams/Subscription; invoke-interface {v0, p1, p2}, Lorg/reactivestreams/Subscription;->request(J)V return-void .end method