a.smali

.class public final Lio/reactivex/subscribers/a;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lio/reactivex/g;
.implements Lorg/reactivestreams/c;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;",
        "Lio/reactivex/g<",
        "TT;>;",
        "Lorg/reactivestreams/c;"
    }
.end annotation


# instance fields
.field public final a:Lorg/reactivestreams/b;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lorg/reactivestreams/b<",
            "-TT;>;"
        }
    .end annotation
.end field

.field public b:Lorg/reactivestreams/c;

.field public c:Z

.field public d:Lio/reactivex/internal/util/a;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lio/reactivex/internal/util/a<",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field public volatile e:Z


# direct methods
.method public constructor <init>(Lorg/reactivestreams/b;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/reactivestreams/b<",
            "-TT;>;)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p1, p0, Lio/reactivex/subscribers/a;->a:Lorg/reactivestreams/b;

    return-void
.end method


# virtual methods
.method public final cancel()V
    .registers 2

    iget-object v0, p0, Lio/reactivex/subscribers/a;->b:Lorg/reactivestreams/c;

    invoke-interface {v0}, Lorg/reactivestreams/c;->cancel()V

    return-void
.end method

.method public final onComplete()V
    .registers 3

    .line 1
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    if-eqz v0, :cond_5

    return-void

    .line 2
    :cond_5
    monitor-enter p0

    .line 3
    :try_start_6
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    if-eqz v0, :cond_c

    .line 4
    monitor-exit p0

    return-void

    .line 5
    :cond_c
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->c:Z

    if-eqz v0, :cond_24

    .line 6
    iget-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    if-nez v0, :cond_1b

    .line 7
    new-instance v0, Lio/reactivex/internal/util/a;

    invoke-direct {v0}, Lio/reactivex/internal/util/a;-><init>()V

    .line 8
    iput-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    .line 9
    :cond_1b
    invoke-static {}, Lio/reactivex/internal/util/j;->complete()Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v0, v1}, Lio/reactivex/internal/util/a;->b(Ljava/lang/Object;)V

    .line 10
    monitor-exit p0

    return-void

    :cond_24
    const/4 v0, 0x1

    .line 11
    iput-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    .line 12
    iput-boolean v0, p0, Lio/reactivex/subscribers/a;->c:Z

    .line 13
    monitor-exit p0
    :try_end_2a
    .catchall {:try_start_6 .. :try_end_2a} :catchall_30

    .line 14
    iget-object v0, p0, Lio/reactivex/subscribers/a;->a:Lorg/reactivestreams/b;

    invoke-interface {v0}, Lorg/reactivestreams/b;->onComplete()V

    return-void

    :catchall_30
    move-exception v0

    .line 15
    :try_start_31
    monitor-exit p0
    :try_end_32
    .catchall {:try_start_31 .. :try_end_32} :catchall_30

    throw v0
.end method

.method public final onError(Ljava/lang/Throwable;)V
    .registers 4

    .line 1
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    if-eqz v0, :cond_8

    .line 2
    invoke-static {p1}, Lio/reactivex/plugins/a;->b(Ljava/lang/Throwable;)V

    return-void

    .line 3
    :cond_8
    monitor-enter p0

    .line 4
    :try_start_9
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    const/4 v1, 0x1

    if-eqz v0, :cond_f

    goto :goto_2e

    .line 5
    :cond_f
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->c:Z

    if-eqz v0, :cond_29

    .line 6
    iput-boolean v1, p0, Lio/reactivex/subscribers/a;->e:Z

    .line 7
    iget-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    if-nez v0, :cond_20

    .line 8
    new-instance v0, Lio/reactivex/internal/util/a;

    invoke-direct {v0}, Lio/reactivex/internal/util/a;-><init>()V

    .line 9
    iput-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    .line 10
    :cond_20
    invoke-static {p1}, Lio/reactivex/internal/util/j;->error(Ljava/lang/Throwable;)Ljava/lang/Object;

    move-result-object p1

    .line 11
    invoke-virtual {v0, p1}, Lio/reactivex/internal/util/a;->d(Ljava/lang/Object;)V

    .line 12
    monitor-exit p0

    return-void

    .line 13
    :cond_29
    iput-boolean v1, p0, Lio/reactivex/subscribers/a;->e:Z

    .line 14
    iput-boolean v1, p0, Lio/reactivex/subscribers/a;->c:Z

    const/4 v1, 0x0

    .line 15
    :goto_2e
    monitor-exit p0
    :try_end_2f
    .catchall {:try_start_9 .. :try_end_2f} :catchall_3b

    if-eqz v1, :cond_35

    .line 16
    invoke-static {p1}, Lio/reactivex/plugins/a;->b(Ljava/lang/Throwable;)V

    return-void

    .line 17
    :cond_35
    iget-object v0, p0, Lio/reactivex/subscribers/a;->a:Lorg/reactivestreams/b;

    invoke-interface {v0, p1}, Lorg/reactivestreams/b;->onError(Ljava/lang/Throwable;)V

    return-void

    :catchall_3b
    move-exception p1

    .line 18
    :try_start_3c
    monitor-exit p0
    :try_end_3d
    .catchall {:try_start_3c .. :try_end_3d} :catchall_3b

    throw p1
.end method

.method public final onNext(Ljava/lang/Object;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    if-eqz v0, :cond_5

    return-void

    :cond_5
    if-nez p1, :cond_17

    .line 2
    iget-object p1, p0, Lio/reactivex/subscribers/a;->b:Lorg/reactivestreams/c;

    invoke-interface {p1}, Lorg/reactivestreams/c;->cancel()V

    .line 3
    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;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, p1}, Lio/reactivex/subscribers/a;->onError(Ljava/lang/Throwable;)V

    return-void

    .line 4
    :cond_17
    monitor-enter p0

    .line 5
    :try_start_18
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->e:Z

    if-eqz v0, :cond_1e

    .line 6
    monitor-exit p0

    return-void

    .line 7
    :cond_1e
    iget-boolean v0, p0, Lio/reactivex/subscribers/a;->c:Z

    if-eqz v0, :cond_36

    .line 8
    iget-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    if-nez v0, :cond_2d

    .line 9
    new-instance v0, Lio/reactivex/internal/util/a;

    invoke-direct {v0}, Lio/reactivex/internal/util/a;-><init>()V

    .line 10
    iput-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    .line 11
    :cond_2d
    invoke-static {p1}, Lio/reactivex/internal/util/j;->next(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    invoke-virtual {v0, p1}, Lio/reactivex/internal/util/a;->b(Ljava/lang/Object;)V

    .line 12
    monitor-exit p0

    return-void

    :cond_36
    const/4 v0, 0x1

    .line 13
    iput-boolean v0, p0, Lio/reactivex/subscribers/a;->c:Z

    .line 14
    monitor-exit p0
    :try_end_3a
    .catchall {:try_start_18 .. :try_end_3a} :catchall_59

    .line 15
    iget-object v0, p0, Lio/reactivex/subscribers/a;->a:Lorg/reactivestreams/b;

    invoke-interface {v0, p1}, Lorg/reactivestreams/b;->onNext(Ljava/lang/Object;)V

    .line 16
    :cond_3f
    monitor-enter p0

    .line 17
    :try_start_40
    iget-object p1, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    if-nez p1, :cond_49

    const/4 p1, 0x0

    .line 18
    iput-boolean p1, p0, Lio/reactivex/subscribers/a;->c:Z

    .line 19
    monitor-exit p0

    goto :goto_55

    :cond_49
    const/4 v0, 0x0

    .line 20
    iput-object v0, p0, Lio/reactivex/subscribers/a;->d:Lio/reactivex/internal/util/a;

    .line 21
    monitor-exit p0
    :try_end_4d
    .catchall {:try_start_40 .. :try_end_4d} :catchall_56

    .line 22
    iget-object v0, p0, Lio/reactivex/subscribers/a;->a:Lorg/reactivestreams/b;

    invoke-virtual {p1, v0}, Lio/reactivex/internal/util/a;->a(Lorg/reactivestreams/b;)Z

    move-result p1

    if-eqz p1, :cond_3f

    :goto_55
    return-void

    :catchall_56
    move-exception p1

    .line 23
    :try_start_57
    monitor-exit p0
    :try_end_58
    .catchall {:try_start_57 .. :try_end_58} :catchall_56

    throw p1

    :catchall_59
    move-exception p1

    .line 24
    :try_start_5a
    monitor-exit p0
    :try_end_5b
    .catchall {:try_start_5a .. :try_end_5b} :catchall_59

    throw p1
.end method

.method public final onSubscribe(Lorg/reactivestreams/c;)V
    .registers 3

    .line 1
    iget-object v0, p0, Lio/reactivex/subscribers/a;->b:Lorg/reactivestreams/c;

    invoke-static {v0, p1}, Lio/reactivex/internal/subscriptions/f;->validate(Lorg/reactivestreams/c;Lorg/reactivestreams/c;)Z

    move-result v0

    if-eqz v0, :cond_f

    .line 2
    iput-object p1, p0, Lio/reactivex/subscribers/a;->b:Lorg/reactivestreams/c;

    .line 3
    iget-object p1, p0, Lio/reactivex/subscribers/a;->a:Lorg/reactivestreams/b;

    invoke-interface {p1, p0}, Lorg/reactivestreams/b;->onSubscribe(Lorg/reactivestreams/c;)V

    :cond_f
    return-void
.end method

.method public final request(J)V
    .registers 4

    iget-object v0, p0, Lio/reactivex/subscribers/a;->b:Lorg/reactivestreams/c;

    invoke-interface {v0, p1, p2}, Lorg/reactivestreams/c;->request(J)V

    return-void
.end method