Rabbit-R1/switch port/smali/smali_classes3/io/sentry/MonitorContexts.smali
2024-05-21 17:08:36 -04:00

257 lines
5.9 KiB
Smali

.class public final Lio/sentry/MonitorContexts;
.super Ljava/util/concurrent/ConcurrentHashMap;
.source "MonitorContexts.java"
# interfaces
.implements Lio/sentry/JsonSerializable;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lio/sentry/MonitorContexts$Deserializer;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/concurrent/ConcurrentHashMap<",
"Ljava/lang/String;",
"Ljava/lang/Object;",
">;",
"Lio/sentry/JsonSerializable;"
}
.end annotation
# static fields
.field private static final serialVersionUID:J = 0x3755d6f1f6298bdcL
# direct methods
.method public constructor <init>()V
.locals 0
.line 18
invoke-direct {p0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
return-void
.end method
.method public constructor <init>(Lio/sentry/MonitorContexts;)V
.locals 4
.line 20
invoke-direct {p0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
.line 21
invoke-virtual {p1}, Lio/sentry/MonitorContexts;->entrySet()Ljava/util/Set;
move-result-object p1
invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object p1
:cond_0
:goto_0
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_2
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/util/Map$Entry;
if-eqz v0, :cond_0
.line 23
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v1
const-string v2, "trace"
.line 24
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_1
instance-of v2, v1, Lio/sentry/SpanContext;
if-eqz v2, :cond_1
.line 25
new-instance v0, Lio/sentry/SpanContext;
check-cast v1, Lio/sentry/SpanContext;
invoke-direct {v0, v1}, Lio/sentry/SpanContext;-><init>(Lio/sentry/SpanContext;)V
invoke-virtual {p0, v0}, Lio/sentry/MonitorContexts;->setTrace(Lio/sentry/SpanContext;)V
goto :goto_0
.line 27
:cond_1
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-virtual {p0, v0, v1}, Lio/sentry/MonitorContexts;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_0
:cond_2
return-void
.end method
.method private toContextType(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/lang/String;",
"Ljava/lang/Class<",
"TT;>;)TT;"
}
.end annotation
.line 34
invoke-virtual {p0, p1}, Lio/sentry/MonitorContexts;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
.line 35
invoke-virtual {p2, p0}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z
move-result p1
if-eqz p1, :cond_0
invoke-virtual {p2, p0}, Ljava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return-object p0
.end method
# virtual methods
.method public getTrace()Lio/sentry/SpanContext;
.locals 2
const-string v0, "trace"
.line 39
const-class v1, Lio/sentry/SpanContext;
invoke-direct {p0, v0, v1}, Lio/sentry/MonitorContexts;->toContextType(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Lio/sentry/SpanContext;
return-object p0
.end method
.method public serialize(Lio/sentry/ObjectWriter;Lio/sentry/ILogger;)V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 52
invoke-interface {p1}, Lio/sentry/ObjectWriter;->beginObject()Lio/sentry/ObjectWriter;
.line 54
invoke-virtual {p0}, Lio/sentry/MonitorContexts;->keys()Ljava/util/Enumeration;
move-result-object v0
invoke-static {v0}, Ljava/util/Collections;->list(Ljava/util/Enumeration;)Ljava/util/ArrayList;
move-result-object v0
.line 55
invoke-static {v0}, Ljava/util/Collections;->sort(Ljava/util/List;)V
.line 56
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/String;
.line 57
invoke-virtual {p0, v1}, Lio/sentry/MonitorContexts;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
if-eqz v2, :cond_0
.line 59
invoke-interface {p1, v1}, Lio/sentry/ObjectWriter;->name(Ljava/lang/String;)Lio/sentry/ObjectWriter;
move-result-object v1
invoke-interface {v1, p2, v2}, Lio/sentry/ObjectWriter;->value(Lio/sentry/ILogger;Ljava/lang/Object;)Lio/sentry/ObjectWriter;
goto :goto_0
.line 62
:cond_1
invoke-interface {p1}, Lio/sentry/ObjectWriter;->endObject()Lio/sentry/ObjectWriter;
return-void
.end method
.method public setTrace(Lio/sentry/SpanContext;)V
.locals 1
const-string v0, "traceContext is required"
.line 43
invoke-static {p1, v0}, Lio/sentry/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
const-string v0, "trace"
.line 44
invoke-virtual {p0, v0, p1}, Lio/sentry/MonitorContexts;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
return-void
.end method