336 lines
6.3 KiB
Smali
336 lines
6.3 KiB
Smali
.class public final Lz/n/c/f;
|
|
.super Ljava/lang/Object;
|
|
.source "CollectionToArray.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final a:[Ljava/lang/Object;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
sput-object v0, Lz/n/c/f;->a:[Ljava/lang/Object;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final toArray(Ljava/util/Collection;)[Ljava/lang/Object;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"*>;)[",
|
|
"Ljava/lang/Object;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "collection"
|
|
|
|
invoke-static {p0, v0}, Lz/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
:goto_0
|
|
sget-object p0, Lz/n/c/f;->a:[Ljava/lang/Object;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_1
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v1, 0x1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v0, v1
|
|
|
|
array-length v1, v0
|
|
|
|
if-lt v2, v1, :cond_5
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
move-object p0, v0
|
|
|
|
goto :goto_3
|
|
|
|
:cond_2
|
|
mul-int/lit8 v1, v2, 0x3
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
ushr-int/lit8 v1, v1, 0x1
|
|
|
|
const v3, 0x7ffffffd
|
|
|
|
if-gt v1, v2, :cond_4
|
|
|
|
if-ge v2, v3, :cond_3
|
|
|
|
const v1, 0x7ffffffd
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
new-instance p0, Ljava/lang/OutOfMemoryError;
|
|
|
|
invoke-direct {p0}, Ljava/lang/OutOfMemoryError;-><init>()V
|
|
|
|
throw p0
|
|
|
|
:cond_4
|
|
:goto_2
|
|
invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Arrays.copyOf(result, newSize)"
|
|
|
|
invoke-static {v0, v1}, Lz/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_5
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_6
|
|
|
|
invoke-static {v0, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "Arrays.copyOf(result, size)"
|
|
|
|
invoke-static {p0, v0}, Lz/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:goto_3
|
|
return-object p0
|
|
|
|
:cond_6
|
|
:goto_4
|
|
move v1, v2
|
|
|
|
goto :goto_1
|
|
.end method
|
|
|
|
.method public static final toArray(Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"*>;[",
|
|
"Ljava/lang/Object;",
|
|
")[",
|
|
"Ljava/lang/Object;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "collection"
|
|
|
|
invoke-static {p0, v0}, Lz/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_b
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
array-length p0, p1
|
|
|
|
if-lez p0, :cond_8
|
|
|
|
aput-object v0, p1, v2
|
|
|
|
goto/16 :goto_2
|
|
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
array-length p0, p1
|
|
|
|
if-lez p0, :cond_8
|
|
|
|
aput-object v0, p1, v2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
array-length v3, p1
|
|
|
|
if-gt v1, v3, :cond_2
|
|
|
|
move-object v1, p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3, v1}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_a
|
|
|
|
check-cast v1, [Ljava/lang/Object;
|
|
|
|
:goto_0
|
|
add-int/lit8 v3, v2, 0x1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v1, v2
|
|
|
|
array-length v2, v1
|
|
|
|
if-lt v3, v2, :cond_6
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
move-object p1, v1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
mul-int/lit8 v2, v3, 0x3
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
ushr-int/lit8 v2, v2, 0x1
|
|
|
|
const v4, 0x7ffffffd
|
|
|
|
if-gt v2, v3, :cond_5
|
|
|
|
if-ge v3, v4, :cond_4
|
|
|
|
const v2, 0x7ffffffd
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
new-instance p0, Ljava/lang/OutOfMemoryError;
|
|
|
|
invoke-direct {p0}, Ljava/lang/OutOfMemoryError;-><init>()V
|
|
|
|
throw p0
|
|
|
|
:cond_5
|
|
:goto_1
|
|
invoke-static {v1, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "Arrays.copyOf(result, newSize)"
|
|
|
|
invoke-static {v1, v2}, Lz/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_6
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_9
|
|
|
|
if-ne v1, p1, :cond_7
|
|
|
|
aput-object v0, p1, v3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_7
|
|
invoke-static {v1, v3}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p0, "Arrays.copyOf(result, size)"
|
|
|
|
invoke-static {p1, p0}, Lz/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:cond_8
|
|
:goto_2
|
|
return-object p1
|
|
|
|
:cond_9
|
|
:goto_3
|
|
move v2, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_a
|
|
new-instance p0, Ljava/lang/NullPointerException;
|
|
|
|
const-string p1, "null cannot be cast to non-null type kotlin.Array<kotlin.Any?>"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_b
|
|
throw v0
|
|
.end method
|