TypesJVMKt.smali
.class public final Lkotlin/reflect/TypesJVMKt;
.super Ljava/lang/Object;
.source "TypesJVM.kt"
# annotations
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u00000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0000\n\u0002\u0010\u000e\n\u0002\u0008\u0003\n\u0002\u0010\u000b\n\u0000\u001a\"\u0010\n\u001a\u00020\u00012\n\u0010\u000b\u001a\u0006\u0012\u0002\u0008\u00030\u000c2\u000c\u0010\r\u001a\u0008\u0012\u0004\u0012\u00020\u00070\u000eH\u0003\u001a\u0010\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0001H\u0002\u001a\u0016\u0010\u0012\u001a\u00020\u0001*\u00020\u00022\u0008\u0008\u0002\u0010\u0013\u001a\u00020\u0014H\u0003\"\u001e\u0010\u0000\u001a\u00020\u0001*\u00020\u00028FX\u0087\u0004\u00a2\u0006\u000c\u0012\u0004\u0008\u0003\u0010\u0004\u001a\u0004\u0008\u0005\u0010\u0006\"\u001e\u0010\u0000\u001a\u00020\u0001*\u00020\u00078BX\u0083\u0004\u00a2\u0006\u000c\u0012\u0004\u0008\u0003\u0010\u0008\u001a\u0004\u0008\u0005\u0010\t\u00a8\u0006\u0015"
}
d2 = {
"javaType",
"Ljava/lang/reflect/Type;",
"Lkotlin/reflect/KType;",
"getJavaType$annotations",
"(Lkotlin/reflect/KType;)V",
"getJavaType",
"(Lkotlin/reflect/KType;)Ljava/lang/reflect/Type;",
"Lkotlin/reflect/KTypeProjection;",
"(Lkotlin/reflect/KTypeProjection;)V",
"(Lkotlin/reflect/KTypeProjection;)Ljava/lang/reflect/Type;",
"createPossiblyInnerType",
"jClass",
"Ljava/lang/Class;",
"arguments",
"",
"typeToString",
"",
"type",
"computeJavaType",
"forceWrapper",
"",
"kotlin-stdlib"
}
k = 0x2
mv = {
0x1,
0x4,
0x1
}
.end annotation
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public static final synthetic access$computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
.registers 2
invoke-static {p0, p1}, Lkotlin/reflect/TypesJVMKt;->computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
move-result-object p0
return-object p0
.end method
.method public static final synthetic access$typeToString(Ljava/lang/reflect/Type;)Ljava/lang/String;
.registers 1
invoke-static {p0}, Lkotlin/reflect/TypesJVMKt;->typeToString(Ljava/lang/reflect/Type;)Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public static final computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
.registers 5
.annotation build Lkotlin/ExperimentalStdlibApi;
.end annotation
invoke-interface {p0}, Lkotlin/reflect/KType;->getClassifier()Lkotlin/reflect/KClassifier;
move-result-object v0
instance-of v1, v0, Lkotlin/reflect/KTypeParameter;
if-eqz v1, :cond_10
new-instance p0, Lkotlin/reflect/TypeVariableImpl;
check-cast v0, Lkotlin/reflect/KTypeParameter;
invoke-direct {p0, v0}, Lkotlin/reflect/TypeVariableImpl;-><init>(Lkotlin/reflect/KTypeParameter;)V
return-object p0
:cond_10
instance-of v1, v0, Lkotlin/reflect/KClass;
if-eqz v1, :cond_9d
check-cast v0, Lkotlin/reflect/KClass;
if-eqz p1, :cond_1d
invoke-static {v0}, Lkotlin/jvm/JvmClassMappingKt;->getJavaObjectType(Lkotlin/reflect/KClass;)Ljava/lang/Class;
move-result-object p1
goto :goto_21
:cond_1d
invoke-static {v0}, Lkotlin/jvm/JvmClassMappingKt;->getJavaClass(Lkotlin/reflect/KClass;)Ljava/lang/Class;
move-result-object p1
:goto_21
invoke-interface {p0}, Lkotlin/reflect/KType;->getArguments()Ljava/util/List;
move-result-object v0
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v1
if-eqz v1, :cond_2c
return-object p1
:cond_2c
invoke-virtual {p1}, Ljava/lang/Class;->isArray()Z
move-result v1
if-eqz v1, :cond_98
invoke-virtual {p1}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
move-result-object v1
const-string v2, "jClass.componentType"
invoke-static {v1, v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Class;->isPrimitive()Z
move-result v1
if-eqz v1, :cond_42
return-object p1
:cond_42
invoke-static {v0}, Lkotlin/collections/CollectionsKt___CollectionsKt;->singleOrNull(Ljava/util/List;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lkotlin/reflect/KTypeProjection;
if-eqz v0, :cond_81
invoke-virtual {v0}, Lkotlin/reflect/KTypeProjection;->component1()Lkotlin/reflect/KVariance;
move-result-object p0
invoke-virtual {v0}, Lkotlin/reflect/KTypeProjection;->component2()Lkotlin/reflect/KType;
move-result-object v0
if-nez p0, :cond_55
goto :goto_80
:cond_55
sget-object v1, Lkotlin/reflect/TypesJVMKt$WhenMappings;->$EnumSwitchMapping$0:[I
invoke-virtual {p0}, Ljava/lang/Enum;->ordinal()I
move-result p0
aget p0, v1, p0
const/4 v1, 0x1
if-eq p0, v1, :cond_80
const/4 v2, 0x2
if-eq p0, v2, :cond_6d
const/4 v2, 0x3
if-ne p0, v2, :cond_67
goto :goto_6d
:cond_67
new-instance p0, Lkotlin/NoWhenBranchMatchedException;
invoke-direct {p0}, Lkotlin/NoWhenBranchMatchedException;-><init>()V
throw p0
:cond_6d
:goto_6d
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
const/4 p0, 0x0
const/4 v2, 0x0
invoke-static {v0, p0, v1, v2}, Lkotlin/reflect/TypesJVMKt;->computeJavaType$default(Lkotlin/reflect/KType;ZILjava/lang/Object;)Ljava/lang/reflect/Type;
move-result-object p0
instance-of v0, p0, Ljava/lang/Class;
if-eqz v0, :cond_7b
goto :goto_80
:cond_7b
new-instance p1, Lkotlin/reflect/GenericArrayTypeImpl;
invoke-direct {p1, p0}, Lkotlin/reflect/GenericArrayTypeImpl;-><init>(Ljava/lang/reflect/Type;)V
:cond_80
:goto_80
return-object p1
:cond_81
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "kotlin.Array must have exactly one type argument: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_98
invoke-static {p1, v0}, Lkotlin/reflect/TypesJVMKt;->createPossiblyInnerType(Ljava/lang/Class;Ljava/util/List;)Ljava/lang/reflect/Type;
move-result-object p0
return-object p0
:cond_9d
new-instance p1, Ljava/lang/UnsupportedOperationException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Unsupported type classifier: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public static synthetic computeJavaType$default(Lkotlin/reflect/KType;ZILjava/lang/Object;)Ljava/lang/reflect/Type;
.registers 4
and-int/lit8 p2, p2, 0x1
if-eqz p2, :cond_5
const/4 p1, 0x0
:cond_5
invoke-static {p0, p1}, Lkotlin/reflect/TypesJVMKt;->computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
move-result-object p0
return-object p0
.end method
.method public static final createPossiblyInnerType(Ljava/lang/Class;Ljava/util/List;)Ljava/lang/reflect/Type;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Class<",
"*>;",
"Ljava/util/List<",
"Lkotlin/reflect/KTypeProjection;",
">;)",
"Ljava/lang/reflect/Type;"
}
.end annotation
.annotation build Lkotlin/ExperimentalStdlibApi;
.end annotation
invoke-virtual {p0}, Ljava/lang/Class;->getDeclaringClass()Ljava/lang/Class;
move-result-object v0
const/16 v1, 0xa
if-eqz v0, :cond_76
invoke-virtual {p0}, Ljava/lang/Class;->getModifiers()I
move-result v2
invoke-static {v2}, Ljava/lang/reflect/Modifier;->isStatic(I)Z
move-result v2
if-eqz v2, :cond_39
new-instance v2, Ljava/util/ArrayList;
invoke-static {p1, v1}, Lkotlin/collections/CollectionsKt__IterablesKt;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
move-result v1
invoke-direct {v2, v1}, Ljava/util/ArrayList;-><init>(I)V
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object p1
:goto_1f
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_33
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lkotlin/reflect/KTypeProjection;
invoke-static {v1}, Lkotlin/reflect/TypesJVMKt;->getJavaType(Lkotlin/reflect/KTypeProjection;)Ljava/lang/reflect/Type;
move-result-object v1
invoke-interface {v2, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_1f
:cond_33
new-instance p1, Lkotlin/reflect/ParameterizedTypeImpl;
invoke-direct {p1, p0, v0, v2}, Lkotlin/reflect/ParameterizedTypeImpl;-><init>(Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/util/List;)V
return-object p1
:cond_39
invoke-virtual {p0}, Ljava/lang/Class;->getTypeParameters()[Ljava/lang/reflect/TypeVariable;
move-result-object v2
array-length v2, v2
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v3
invoke-interface {p1, v2, v3}, Ljava/util/List;->subList(II)Ljava/util/List;
move-result-object v3
invoke-static {v0, v3}, Lkotlin/reflect/TypesJVMKt;->createPossiblyInnerType(Ljava/lang/Class;Ljava/util/List;)Ljava/lang/reflect/Type;
move-result-object v0
const/4 v3, 0x0
invoke-interface {p1, v3, v2}, Ljava/util/List;->subList(II)Ljava/util/List;
move-result-object p1
new-instance v2, Ljava/util/ArrayList;
invoke-static {p1, v1}, Lkotlin/collections/CollectionsKt__IterablesKt;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
move-result v1
invoke-direct {v2, v1}, Ljava/util/ArrayList;-><init>(I)V
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object p1
:goto_5c
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_70
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lkotlin/reflect/KTypeProjection;
invoke-static {v1}, Lkotlin/reflect/TypesJVMKt;->getJavaType(Lkotlin/reflect/KTypeProjection;)Ljava/lang/reflect/Type;
move-result-object v1
invoke-interface {v2, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_5c
:cond_70
new-instance p1, Lkotlin/reflect/ParameterizedTypeImpl;
invoke-direct {p1, p0, v0, v2}, Lkotlin/reflect/ParameterizedTypeImpl;-><init>(Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/util/List;)V
return-object p1
:cond_76
const/4 v0, 0x0
new-instance v2, Ljava/util/ArrayList;
invoke-static {p1, v1}, Lkotlin/collections/CollectionsKt__IterablesKt;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
move-result v1
invoke-direct {v2, v1}, Ljava/util/ArrayList;-><init>(I)V
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object p1
:goto_84
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_98
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lkotlin/reflect/KTypeProjection;
invoke-static {v1}, Lkotlin/reflect/TypesJVMKt;->getJavaType(Lkotlin/reflect/KTypeProjection;)Ljava/lang/reflect/Type;
move-result-object v1
invoke-interface {v2, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_84
:cond_98
new-instance p1, Lkotlin/reflect/ParameterizedTypeImpl;
invoke-direct {p1, p0, v0, v2}, Lkotlin/reflect/ParameterizedTypeImpl;-><init>(Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/util/List;)V
return-object p1
.end method
.method public static final getJavaType(Lkotlin/reflect/KType;)Ljava/lang/reflect/Type;
.registers 4
const-string v0, "$this$javaType"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
instance-of v0, p0, Lkotlin/jvm/internal/KTypeBase;
if-eqz v0, :cond_13
move-object v0, p0
check-cast v0, Lkotlin/jvm/internal/KTypeBase;
invoke-interface {v0}, Lkotlin/jvm/internal/KTypeBase;->getJavaType()Ljava/lang/reflect/Type;
move-result-object v0
if-eqz v0, :cond_13
return-object v0
:cond_13
const/4 v0, 0x0
const/4 v1, 0x1
const/4 v2, 0x0
invoke-static {p0, v0, v1, v2}, Lkotlin/reflect/TypesJVMKt;->computeJavaType$default(Lkotlin/reflect/KType;ZILjava/lang/Object;)Ljava/lang/reflect/Type;
move-result-object p0
return-object p0
.end method
.method public static final getJavaType(Lkotlin/reflect/KTypeProjection;)Ljava/lang/reflect/Type;
.registers 5
invoke-virtual {p0}, Lkotlin/reflect/KTypeProjection;->getVariance()Lkotlin/reflect/KVariance;
move-result-object v0
if-eqz v0, :cond_3e
invoke-virtual {p0}, Lkotlin/reflect/KTypeProjection;->getType()Lkotlin/reflect/KType;
move-result-object p0
invoke-static {p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
sget-object v1, Lkotlin/reflect/TypesJVMKt$WhenMappings;->$EnumSwitchMapping$1:[I
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
move-result v0
aget v0, v1, v0
const/4 v1, 0x1
if-eq v0, v1, :cond_39
const/4 v2, 0x2
const/4 v3, 0x0
if-eq v0, v2, :cond_2f
const/4 v2, 0x3
if-ne v0, v2, :cond_29
new-instance v0, Lkotlin/reflect/WildcardTypeImpl;
invoke-static {p0, v1}, Lkotlin/reflect/TypesJVMKt;->computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
move-result-object p0
invoke-direct {v0, p0, v3}, Lkotlin/reflect/WildcardTypeImpl;-><init>(Ljava/lang/reflect/Type;Ljava/lang/reflect/Type;)V
goto :goto_3d
:cond_29
new-instance p0, Lkotlin/NoWhenBranchMatchedException;
invoke-direct {p0}, Lkotlin/NoWhenBranchMatchedException;-><init>()V
throw p0
:cond_2f
new-instance v0, Lkotlin/reflect/WildcardTypeImpl;
invoke-static {p0, v1}, Lkotlin/reflect/TypesJVMKt;->computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
move-result-object p0
invoke-direct {v0, v3, p0}, Lkotlin/reflect/WildcardTypeImpl;-><init>(Ljava/lang/reflect/Type;Ljava/lang/reflect/Type;)V
goto :goto_3d
:cond_39
invoke-static {p0, v1}, Lkotlin/reflect/TypesJVMKt;->computeJavaType(Lkotlin/reflect/KType;Z)Ljava/lang/reflect/Type;
move-result-object v0
:goto_3d
return-object v0
:cond_3e
sget-object p0, Lkotlin/reflect/WildcardTypeImpl;->Companion:Lkotlin/reflect/WildcardTypeImpl$Companion;
invoke-virtual {p0}, Lkotlin/reflect/WildcardTypeImpl$Companion;->getSTAR()Lkotlin/reflect/WildcardTypeImpl;
move-result-object p0
return-object p0
.end method
.method public static synthetic getJavaType$annotations(Lkotlin/reflect/KType;)V
.registers 1
.annotation build Lkotlin/ExperimentalStdlibApi;
.end annotation
.annotation build Lkotlin/SinceKotlin;
version = "1.4"
.end annotation
.annotation build Lkotlin/internal/LowPriorityInOverloadResolution;
.end annotation
return-void
.end method
.method public static synthetic getJavaType$annotations(Lkotlin/reflect/KTypeProjection;)V
.registers 1
.annotation build Lkotlin/ExperimentalStdlibApi;
.end annotation
return-void
.end method
.method public static final typeToString(Ljava/lang/reflect/Type;)Ljava/lang/String;
.registers 3
instance-of v0, p0, Ljava/lang/Class;
if-eqz v0, :cond_41
move-object v0, p0
check-cast v0, Ljava/lang/Class;
invoke-virtual {v0}, Ljava/lang/Class;->isArray()Z
move-result v1
if-eqz v1, :cond_37
sget-object v0, Lkotlin/reflect/TypesJVMKt$typeToString$unwrap$1;->INSTANCE:Lkotlin/reflect/TypesJVMKt$typeToString$unwrap$1;
invoke-static {p0, v0}, Lkotlin/sequences/SequencesKt__SequencesKt;->generateSequence(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
move-result-object p0
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-static {p0}, Lkotlin/sequences/SequencesKt___SequencesKt;->last(Lkotlin/sequences/Sequence;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/Class;
invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {p0}, Lkotlin/sequences/SequencesKt___SequencesKt;->count(Lkotlin/sequences/Sequence;)I
move-result p0
const-string v1, "[]"
invoke-static {v1, p0}, Lkotlin/text/StringsKt__StringsJVMKt;->repeat(Ljava/lang/CharSequence;I)Ljava/lang/String;
move-result-object p0
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
goto :goto_3b
:cond_37
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object p0
:goto_3b
const-string v0, "if (type.isArray) {\n \u2026\n } else type.name"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
goto :goto_45
:cond_41
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
:goto_45
return-object p0
.end method