.class public final Lio/reactivex/internal/util/ExceptionHelper; .super Ljava/lang/Object; .source "ExceptionHelper.java" # static fields .field public static final TERMINATED:Ljava/lang/Throwable; # direct methods .method static constructor ()V .locals 2 .line 52 new-instance v0, Lio/reactivex/internal/util/ExceptionHelper$1; const-string v1, "No further exceptions" invoke-direct {v0, v1}, Lio/reactivex/internal/util/ExceptionHelper$1;->(Ljava/lang/String;)V sput-object v0, Lio/reactivex/internal/util/ExceptionHelper;->TERMINATED:Ljava/lang/Throwable; return-void .end method .method private constructor ()V .locals 2 .line 27 invoke-direct {p0}, Ljava/lang/Object;->()V .line 28 new-instance v0, Ljava/lang/IllegalStateException; const-string v1, "No instances!" invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 .end method .method public static addThrowable(Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/Throwable;)Z .locals 5 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/concurrent/atomic/AtomicReference<", "Ljava/lang/Throwable;", ">;", "Ljava/lang/Throwable;", ")Z" } .end annotation .line 64 :cond_0 invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/Throwable; .line 66 sget-object v1, Lio/reactivex/internal/util/ExceptionHelper;->TERMINATED:Ljava/lang/Throwable; const/4 v2, 0x0 if-ne v0, v1, :cond_1 return v2 :cond_1 const/4 v1, 0x1 if-nez v0, :cond_2 move-object v3, p1 goto :goto_0 .line 74 :cond_2 new-instance v3, Lio/reactivex/exceptions/CompositeException; const/4 v4, 0x2 new-array v4, v4, [Ljava/lang/Throwable; aput-object v0, v4, v2 aput-object p1, v4, v1 invoke-direct {v3, v4}, Lio/reactivex/exceptions/CompositeException;->([Ljava/lang/Throwable;)V .line 77 :goto_0 invoke-virtual {p0, v0, v3}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v1 .end method .method public static flatten(Ljava/lang/Throwable;)Ljava/util/List; .locals 4 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Throwable;", ")", "Ljava/util/List<", "Ljava/lang/Throwable;", ">;" } .end annotation .line 97 new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;->()V .line 98 new-instance v1, Ljava/util/ArrayDeque; invoke-direct {v1}, Ljava/util/ArrayDeque;->()V .line 99 invoke-virtual {v1, p0}, Ljava/util/ArrayDeque;->offer(Ljava/lang/Object;)Z .line 101 :cond_0 :goto_0 invoke-virtual {v1}, Ljava/util/ArrayDeque;->isEmpty()Z move-result p0 if-nez p0, :cond_2 .line 102 invoke-virtual {v1}, Ljava/util/ArrayDeque;->removeFirst()Ljava/lang/Object; move-result-object p0 check-cast p0, Ljava/lang/Throwable; .line 103 instance-of v2, p0, Lio/reactivex/exceptions/CompositeException; if-eqz v2, :cond_1 .line 104 check-cast p0, Lio/reactivex/exceptions/CompositeException; .line 105 invoke-virtual {p0}, Lio/reactivex/exceptions/CompositeException;->getExceptions()Ljava/util/List; move-result-object p0 .line 106 invoke-interface {p0}, Ljava/util/List;->size()I move-result v2 add-int/lit8 v2, v2, -0x1 :goto_1 if-ltz v2, :cond_0 .line 107 invoke-interface {p0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v3 invoke-virtual {v1, v3}, Ljava/util/ArrayDeque;->offerFirst(Ljava/lang/Object;)Z add-int/lit8 v2, v2, -0x1 goto :goto_1 .line 110 :cond_1 invoke-interface {v0, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z goto :goto_0 :cond_2 return-object v0 .end method .method public static terminate(Ljava/util/concurrent/atomic/AtomicReference;)Ljava/lang/Throwable; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/concurrent/atomic/AtomicReference<", "Ljava/lang/Throwable;", ">;)", "Ljava/lang/Throwable;" } .end annotation .line 84 invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/Throwable; .line 85 sget-object v1, Lio/reactivex/internal/util/ExceptionHelper;->TERMINATED:Ljava/lang/Throwable; if-eq v0, v1, :cond_0 .line 86 invoke-virtual {p0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->getAndSet(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p0 move-object v0, p0 check-cast v0, Ljava/lang/Throwable; :cond_0 return-object v0 .end method .method public static wrapOrThrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException; .locals 1 .line 39 instance-of v0, p0, Ljava/lang/Error; if-nez v0, :cond_1 .line 42 instance-of v0, p0, Ljava/lang/RuntimeException; if-eqz v0, :cond_0 .line 43 check-cast p0, Ljava/lang/RuntimeException; return-object p0 .line 45 :cond_0 new-instance v0, Ljava/lang/RuntimeException; invoke-direct {v0, p0}, Ljava/lang/RuntimeException;->(Ljava/lang/Throwable;)V return-object v0 .line 40 :cond_1 check-cast p0, Ljava/lang/Error; throw p0 .end method