.class public final Landroidx/lifecycle/SavedStateViewModelFactoryKt; .super Ljava/lang/Object; .source "SavedStateViewModelFactory.kt" # annotations .annotation runtime Lkotlin/Metadata; d1 = { "\u0000*\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u0000\n\u0002\u0008\u0002\u001a6\u0010\u0004\u001a\n\u0012\u0004\u0012\u0002H\u0006\u0018\u00010\u0005\"\u0004\u0008\u0000\u0010\u00062\u000c\u0010\u0007\u001a\u0008\u0012\u0004\u0012\u0002H\u00060\u00022\u0010\u0010\u0008\u001a\u000c\u0012\u0008\u0012\u0006\u0012\u0002\u0008\u00030\u00020\u0001H\u0000\u001aI\u0010\t\u001a\u0002H\u0006\"\n\u0008\u0000\u0010\u0006*\u0004\u0018\u00010\n2\u000c\u0010\u0007\u001a\u0008\u0012\u0004\u0012\u0002H\u00060\u00022\u000c\u0010\u000b\u001a\u0008\u0012\u0004\u0012\u0002H\u00060\u00052\u0012\u0010\u000c\u001a\n\u0012\u0006\u0008\u0001\u0012\u00020\u000e0\r\"\u00020\u000eH\u0000\u00a2\u0006\u0002\u0010\u000f\"\u0018\u0010\u0000\u001a\u000c\u0012\u0008\u0012\u0006\u0012\u0002\u0008\u00030\u00020\u0001X\u0082\u0004\u00a2\u0006\u0002\n\u0000\"\u0018\u0010\u0003\u001a\u000c\u0012\u0008\u0012\u0006\u0012\u0002\u0008\u00030\u00020\u0001X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0010" } d2 = { "ANDROID_VIEWMODEL_SIGNATURE", "", "Ljava/lang/Class;", "VIEWMODEL_SIGNATURE", "findMatchingConstructor", "Ljava/lang/reflect/Constructor;", "T", "modelClass", "signature", "newInstance", "Landroidx/lifecycle/ViewModel;", "constructor", "params", "", "", "(Ljava/lang/Class;Ljava/lang/reflect/Constructor;[Ljava/lang/Object;)Landroidx/lifecycle/ViewModel;", "lifecycle-viewmodel-savedstate_release" } k = 0x2 mv = { 0x1, 0x8, 0x0 } xi = 0x30 .end annotation # static fields .field private static final ANDROID_VIEWMODEL_SIGNATURE:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List<", "Ljava/lang/Class<", "*>;>;" } .end annotation .end field .field private static final VIEWMODEL_SIGNATURE:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List<", "Ljava/lang/Class<", "*>;>;" } .end annotation .end field # direct methods .method static constructor ()V .locals 3 const/4 v0, 0x2 new-array v0, v0, [Ljava/lang/Class; const/4 v1, 0x0 .line 239 const-class v2, Landroid/app/Application; aput-object v2, v0, v1 const/4 v1, 0x1 const-class v2, Landroidx/lifecycle/SavedStateHandle; aput-object v2, v0, v1 .line 238 invoke-static {v0}, Lkotlin/collections/CollectionsKt;->listOf([Ljava/lang/Object;)Ljava/util/List; move-result-object v0 sput-object v0, Landroidx/lifecycle/SavedStateViewModelFactoryKt;->ANDROID_VIEWMODEL_SIGNATURE:Ljava/util/List; .line 242 const-class v0, Landroidx/lifecycle/SavedStateHandle; invoke-static {v0}, Lkotlin/collections/CollectionsKt;->listOf(Ljava/lang/Object;)Ljava/util/List; move-result-object v0 sput-object v0, Landroidx/lifecycle/SavedStateViewModelFactoryKt;->VIEWMODEL_SIGNATURE:Ljava/util/List; return-void .end method .method public static final synthetic access$getANDROID_VIEWMODEL_SIGNATURE$p()Ljava/util/List; .locals 1 sget-object v0, Landroidx/lifecycle/SavedStateViewModelFactoryKt;->ANDROID_VIEWMODEL_SIGNATURE:Ljava/util/List; return-object v0 .end method .method public static final synthetic access$getVIEWMODEL_SIGNATURE$p()Ljava/util/List; .locals 1 sget-object v0, Landroidx/lifecycle/SavedStateViewModelFactoryKt;->VIEWMODEL_SIGNATURE:Ljava/util/List; return-object v0 .end method .method public static final findMatchingConstructor(Ljava/lang/Class;Ljava/util/List;)Ljava/lang/reflect/Constructor; .locals 6 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Class<", "TT;>;", "Ljava/util/List<", "+", "Ljava/lang/Class<", "*>;>;)", "Ljava/lang/reflect/Constructor<", "TT;>;" } .end annotation const-string v0, "modelClass" invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "signature" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 250 invoke-virtual {p0}, Ljava/lang/Class;->getConstructors()[Ljava/lang/reflect/Constructor; move-result-object v0 const-string v1, "modelClass.constructors" invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V array-length v1, v0 const/4 v2, 0x0 :goto_0 if-ge v2, v1, :cond_3 aget-object v3, v0, v2 .line 251 invoke-virtual {v3}, Ljava/lang/reflect/Constructor;->getParameterTypes()[Ljava/lang/Class; move-result-object v4 const-string v5, "constructor.parameterTypes" invoke-static {v4, v5}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V check-cast v4, [Ljava/lang/Object; invoke-static {v4}, Lkotlin/collections/ArraysKt;->toList([Ljava/lang/Object;)Ljava/util/List; move-result-object v4 .line 252 invoke-static {p1, v4}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_0 const-string p0, "null cannot be cast to non-null type java.lang.reflect.Constructor" .line 254 invoke-static {v3, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V return-object v3 .line 256 :cond_0 invoke-interface {p1}, Ljava/util/List;->size()I move-result v3 invoke-interface {v4}, Ljava/util/List;->size()I move-result v5 if-ne v3, v5, :cond_2 move-object v3, p1 check-cast v3, Ljava/util/Collection; invoke-interface {v4, v3}, Ljava/util/List;->containsAll(Ljava/util/Collection;)Z move-result v3 if-nez v3, :cond_1 goto :goto_1 .line 257 :cond_1 new-instance v0, Ljava/lang/UnsupportedOperationException; .line 258 new-instance v1, Ljava/lang/StringBuilder; const-string v2, "Class " invoke-direct {v1, v2}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String; move-result-object p0 invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 const-string v1, " must have parameters in the proper order: " invoke-virtual {p0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 .line 257 invoke-direct {v0, p0}, Ljava/lang/UnsupportedOperationException;->(Ljava/lang/String;)V throw v0 :cond_2 :goto_1 add-int/lit8 v2, v2, 0x1 goto :goto_0 :cond_3 const/4 p0, 0x0 return-object p0 .end method .method public static final varargs newInstance(Ljava/lang/Class;Ljava/lang/reflect/Constructor;[Ljava/lang/Object;)Landroidx/lifecycle/ViewModel; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Class<", "TT;>;", "Ljava/lang/reflect/Constructor<", "TT;>;[", "Ljava/lang/Object;", ")TT;" } .end annotation const-string v0, "modelClass" invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "constructor" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "params" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 226 :try_start_0 array-length v0, p2 invoke-static {p2, v0}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object p2 invoke-virtual {p1, p2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 check-cast p1, Landroidx/lifecycle/ViewModel; :try_end_0 .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_2 .catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 :catch_0 move-exception p1 .line 232 new-instance p2, Ljava/lang/RuntimeException; .line 233 new-instance v0, Ljava/lang/StringBuilder; const-string v1, "An exception happened in constructor of " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-virtual {p1}, Ljava/lang/reflect/InvocationTargetException;->getCause()Ljava/lang/Throwable; move-result-object p1 .line 232 invoke-direct {p2, p0, p1}, Ljava/lang/RuntimeException;->(Ljava/lang/String;Ljava/lang/Throwable;)V throw p2 :catch_1 move-exception p1 .line 230 new-instance p2, Ljava/lang/RuntimeException; new-instance v0, Ljava/lang/StringBuilder; const-string v1, "A " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 const-string v0, " cannot be instantiated." invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 check-cast p1, Ljava/lang/Throwable; invoke-direct {p2, p0, p1}, Ljava/lang/RuntimeException;->(Ljava/lang/String;Ljava/lang/Throwable;)V throw p2 :catch_2 move-exception p1 .line 228 new-instance p2, Ljava/lang/RuntimeException; new-instance v0, Ljava/lang/StringBuilder; const-string v1, "Failed to access " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 check-cast p1, Ljava/lang/Throwable; invoke-direct {p2, p0, p1}, Ljava/lang/RuntimeException;->(Ljava/lang/String;Ljava/lang/Throwable;)V throw p2 .end method