Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed Apr 9, 2024
1 parent b83a894 commit 9cafe43
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
6 changes: 4 additions & 2 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,7 @@ public abstract interface class io/sentry/ObjectReader : java/io/Closeable {
public abstract fun nextListOrNull (Lio/sentry/ILogger;Lio/sentry/JsonDeserializer;)Ljava/util/List;
public abstract fun nextLong ()J
public abstract fun nextLongOrNull ()Ljava/lang/Long;
public abstract fun nextMapOfListOrNull (Lio/sentry/ILogger;Lio/sentry/JsonDeserializer;)Ljava/util/Map;
public abstract fun nextMapOrNull (Lio/sentry/ILogger;Lio/sentry/JsonDeserializer;)Ljava/util/Map;
public abstract fun nextName ()Ljava/lang/String;
public abstract fun nextNull ()V
Expand Down Expand Up @@ -4346,8 +4347,8 @@ public final class io/sentry/protocol/MetricSummary : io/sentry/JsonSerializable

public final class io/sentry/protocol/MetricSummary$Deserializer : io/sentry/JsonDeserializer {
public fun <init> ()V
public fun deserialize (Lio/sentry/JsonObjectReader;Lio/sentry/ILogger;)Lio/sentry/protocol/MetricSummary;
public synthetic fun deserialize (Lio/sentry/JsonObjectReader;Lio/sentry/ILogger;)Ljava/lang/Object;
public fun deserialize (Lio/sentry/ObjectReader;Lio/sentry/ILogger;)Lio/sentry/protocol/MetricSummary;
public synthetic fun deserialize (Lio/sentry/ObjectReader;Lio/sentry/ILogger;)Ljava/lang/Object;
}

public final class io/sentry/protocol/MetricSummary$JsonKeys {
Expand Down Expand Up @@ -5406,6 +5407,7 @@ public final class io/sentry/util/MapObjectReader : io/sentry/ObjectReader {
public fun nextListOrNull (Lio/sentry/ILogger;Lio/sentry/JsonDeserializer;)Ljava/util/List;
public fun nextLong ()J
public fun nextLongOrNull ()Ljava/lang/Long;
public fun nextMapOfListOrNull (Lio/sentry/ILogger;Lio/sentry/JsonDeserializer;)Ljava/util/Map;
public fun nextMapOrNull (Lio/sentry/ILogger;Lio/sentry/JsonDeserializer;)Ljava/util/Map;
public fun nextName ()Ljava/lang/String;
public fun nextNull ()V
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/JsonObjectReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public void nextUnknown(ILogger logger, Map<String, Object> unknown, String name
return map;
}

@Override
public <T> @Nullable Map<String, List<T>> nextMapOfListOrNull(
@NotNull ILogger logger, @NotNull JsonDeserializer<T> deserializer) throws IOException {

Expand Down
3 changes: 3 additions & 0 deletions sentry/src/main/java/io/sentry/ObjectReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public interface ObjectReader extends Closeable {
<T> @Nullable Map<String, T> nextMapOrNull(
@NotNull ILogger logger, @NotNull JsonDeserializer<T> deserializer) throws IOException;

<T> @Nullable Map<String, List<T>> nextMapOfListOrNull(
@NotNull ILogger logger, @NotNull JsonDeserializer<T> deserializer) throws IOException;

<T> @Nullable T nextOrNull(@NotNull ILogger logger, @NotNull JsonDeserializer<T> deserializer)
throws Exception;

Expand Down
3 changes: 2 additions & 1 deletion sentry/src/main/java/io/sentry/protocol/Geo.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public void serialize(final @NotNull ObjectWriter writer, final @NotNull ILogger
public static final class Deserializer implements JsonDeserializer<Geo> {

@Override
public Geo deserialize(@NotNull ObjectReader reader, ILogger logger) throws Exception {
public @NotNull Geo deserialize(@NotNull ObjectReader reader, @NotNull ILogger logger)
throws Exception {
reader.beginObject();
final Geo geo = new Geo();
Map<String, Object> unknown = null;
Expand Down
4 changes: 2 additions & 2 deletions sentry/src/main/java/io/sentry/protocol/MetricSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import io.sentry.ILogger;
import io.sentry.JsonDeserializer;
import io.sentry.JsonObjectReader;
import io.sentry.JsonSerializable;
import io.sentry.JsonUnknown;
import io.sentry.ObjectReader;
import io.sentry.ObjectWriter;
import io.sentry.util.CollectionUtils;
import io.sentry.vendor.gson.stream.JsonToken;
Expand Down Expand Up @@ -121,7 +121,7 @@ public static final class Deserializer implements JsonDeserializer<MetricSummary

@Override
public @NotNull MetricSummary deserialize(
final @NotNull JsonObjectReader reader, final @NotNull ILogger logger) throws Exception {
final @NotNull ObjectReader reader, final @NotNull ILogger logger) throws Exception {

final @NotNull MetricSummary summary = new MetricSummary();
@Nullable Map<String, Object> unknown = null;
Expand Down
6 changes: 6 additions & 0 deletions sentry/src/main/java/io/sentry/util/MapObjectReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public <T> Map<String, T> nextMapOrNull(
return nextValueOrNull();
}

@Override
public @Nullable <T> Map<String, List<T>> nextMapOfListOrNull(
@NotNull ILogger logger, @NotNull JsonDeserializer<T> deserializer) throws IOException {
return nextValueOrNull();
}

@Nullable
@Override
public <T> T nextOrNull(
Expand Down
8 changes: 8 additions & 0 deletions sentry/src/test/java/io/sentry/util/MapObjectReaderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class MapObjectReaderTest {
writer.name("Collection").value(logger, listOf("a", "b"))
writer.name("Arrays").value(logger, arrayOf("b", "c"))
writer.name("Map").value(logger, mapOf(kotlin.Pair("key", "value")))
writer.name("MapOfLists").value(logger, mapOf("metric_a" to listOf("foo")))
writer.name("Locale").value(logger, Locale.US)
writer.name("URI").value(logger, URI.create("http://www.example.com"))
writer.name("UUID").value(logger, UUID.fromString("00000000-1111-2222-3333-444444444444"))
Expand All @@ -90,6 +91,13 @@ class MapObjectReaderTest {
assertEquals(URI.create("http://www.example.com"), URI.create(reader.nextString()))
assertEquals("Locale", reader.nextName())
assertEquals(Locale.US.toString(), reader.nextString())
assertEquals("MapOfLists", reader.nextName())
reader.beginObject()
assertEquals("metric_a", reader.nextName())
reader.beginArray()
assertEquals("foo", reader.nextStringOrNull())
reader.endArray()
reader.endObject()
assertEquals("Map", reader.nextName())
// nested object
reader.beginObject()
Expand Down

0 comments on commit 9cafe43

Please sign in to comment.