ConsumerSingleObserver.smali 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. .class public final Lio/reactivex/internal/observers/ConsumerSingleObserver;
  2. .super Ljava/util/concurrent/atomic/AtomicReference;
  3. .source "ConsumerSingleObserver.java"
  4. # interfaces
  5. .implements Lio/reactivex/SingleObserver;
  6. .implements Lio/reactivex/disposables/Disposable;
  7. # annotations
  8. .annotation system Ldalvik/annotation/Signature;
  9. value = {
  10. "<T:",
  11. "Ljava/lang/Object;",
  12. ">",
  13. "Ljava/util/concurrent/atomic/AtomicReference<",
  14. "Lio/reactivex/disposables/Disposable;",
  15. ">;",
  16. "Lio/reactivex/SingleObserver<",
  17. "TT;>;",
  18. "Lio/reactivex/disposables/Disposable;"
  19. }
  20. .end annotation
  21. # static fields
  22. .field private static final serialVersionUID:J = -0x614ff1157e55cbc3L
  23. # instance fields
  24. .field final onError:Lio/reactivex/functions/Consumer;
  25. .annotation system Ldalvik/annotation/Signature;
  26. value = {
  27. "Lio/reactivex/functions/Consumer<",
  28. "-",
  29. "Ljava/lang/Throwable;",
  30. ">;"
  31. }
  32. .end annotation
  33. .end field
  34. .field final onSuccess:Lio/reactivex/functions/Consumer;
  35. .annotation system Ldalvik/annotation/Signature;
  36. value = {
  37. "Lio/reactivex/functions/Consumer<",
  38. "-TT;>;"
  39. }
  40. .end annotation
  41. .end field
  42. # direct methods
  43. .method public constructor <init>(Lio/reactivex/functions/Consumer;Lio/reactivex/functions/Consumer;)V
  44. .locals 0
  45. .annotation system Ldalvik/annotation/Signature;
  46. value = {
  47. "(",
  48. "Lio/reactivex/functions/Consumer<",
  49. "-TT;>;",
  50. "Lio/reactivex/functions/Consumer<",
  51. "-",
  52. "Ljava/lang/Throwable;",
  53. ">;)V"
  54. }
  55. .end annotation
  56. .line 36
  57. invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
  58. .line 37
  59. iput-object p1, p0, Lio/reactivex/internal/observers/ConsumerSingleObserver;->onSuccess:Lio/reactivex/functions/Consumer;
  60. .line 38
  61. iput-object p2, p0, Lio/reactivex/internal/observers/ConsumerSingleObserver;->onError:Lio/reactivex/functions/Consumer;
  62. return-void
  63. .end method
  64. # virtual methods
  65. .method public dispose()V
  66. .locals 0
  67. .line 68
  68. invoke-static {p0}, Lio/reactivex/internal/disposables/DisposableHelper;->dispose(Ljava/util/concurrent/atomic/AtomicReference;)Z
  69. return-void
  70. .end method
  71. .method public isDisposed()Z
  72. .locals 2
  73. .line 73
  74. invoke-virtual {p0}, Lio/reactivex/internal/observers/ConsumerSingleObserver;->get()Ljava/lang/Object;
  75. move-result-object v0
  76. sget-object v1, Lio/reactivex/internal/disposables/DisposableHelper;->DISPOSED:Lio/reactivex/internal/disposables/DisposableHelper;
  77. if-ne v0, v1, :cond_0
  78. const/4 v0, 0x1
  79. goto :goto_0
  80. :cond_0
  81. const/4 v0, 0x0
  82. :goto_0
  83. return v0
  84. .end method
  85. .method public onError(Ljava/lang/Throwable;)V
  86. .locals 4
  87. .line 44
  88. :try_start_0
  89. iget-object v0, p0, Lio/reactivex/internal/observers/ConsumerSingleObserver;->onError:Lio/reactivex/functions/Consumer;
  90. invoke-interface {v0, p1}, Lio/reactivex/functions/Consumer;->accept(Ljava/lang/Object;)V
  91. :try_end_0
  92. .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
  93. goto :goto_0
  94. :catch_0
  95. move-exception v0
  96. .line 46
  97. invoke-static {v0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
  98. .line 47
  99. new-instance v1, Lio/reactivex/exceptions/CompositeException;
  100. const/4 v2, 0x2
  101. new-array v2, v2, [Ljava/lang/Throwable;
  102. const/4 v3, 0x0
  103. aput-object p1, v2, v3
  104. const/4 p1, 0x1
  105. aput-object v0, v2, p1
  106. invoke-direct {v1, v2}, Lio/reactivex/exceptions/CompositeException;-><init>([Ljava/lang/Throwable;)V
  107. invoke-static {v1}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
  108. :goto_0
  109. return-void
  110. .end method
  111. .method public onSubscribe(Lio/reactivex/disposables/Disposable;)V
  112. .locals 0
  113. .line 53
  114. invoke-static {p0, p1}, Lio/reactivex/internal/disposables/DisposableHelper;->setOnce(Ljava/util/concurrent/atomic/AtomicReference;Lio/reactivex/disposables/Disposable;)Z
  115. return-void
  116. .end method
  117. .method public onSuccess(Ljava/lang/Object;)V
  118. .locals 1
  119. .annotation system Ldalvik/annotation/Signature;
  120. value = {
  121. "(TT;)V"
  122. }
  123. .end annotation
  124. .line 59
  125. :try_start_0
  126. iget-object v0, p0, Lio/reactivex/internal/observers/ConsumerSingleObserver;->onSuccess:Lio/reactivex/functions/Consumer;
  127. invoke-interface {v0, p1}, Lio/reactivex/functions/Consumer;->accept(Ljava/lang/Object;)V
  128. :try_end_0
  129. .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
  130. goto :goto_0
  131. :catch_0
  132. move-exception p1
  133. .line 61
  134. invoke-static {p1}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
  135. .line 62
  136. invoke-static {p1}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
  137. :goto_0
  138. return-void
  139. .end method