From 670fca63980a442dadd964c14c93a48eb5f7150d Mon Sep 17 00:00:00 2001 From: Gabriel Fukushima Date: Mon, 3 Jun 2024 16:51:00 +1000 Subject: [PATCH] Replace deprecated method (#8351) Signed-off-by: Gabriel Fukushima --- .../java/tech/pegasys/teku/infrastructure/json/JsonUtil.java | 2 +- .../json/types/DeserializableMapTypeDefinition.java | 2 +- .../json/types/DeserializableObjectTypeDefinition.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/JsonUtil.java b/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/JsonUtil.java index da74e68f02e..6c460689a08 100644 --- a/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/JsonUtil.java +++ b/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/JsonUtil.java @@ -155,7 +155,7 @@ private static Optional getAttributeFromParser( while (!parser.isClosed()) { final JsonToken jsonToken = parser.nextToken(); if (JsonToken.FIELD_NAME.equals(jsonToken)) { - final String currentFieldName = parser.getCurrentName(); + final String currentFieldName = parser.currentName(); if (currentFieldName.equals(fieldName)) { if (path.length == i + 1) { parser.nextToken(); diff --git a/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableMapTypeDefinition.java b/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableMapTypeDefinition.java index 125fbd87537..d9899f79bb4 100644 --- a/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableMapTypeDefinition.java +++ b/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableMapTypeDefinition.java @@ -61,7 +61,7 @@ public Map deserialize(final JsonParser p) throws IOException { t = p.nextToken(); } for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) { - final String fieldName = p.getCurrentName(); + final String fieldName = p.currentName(); p.nextToken(); final TValue fieldValue = valueType.deserialize(p); result.put(keyType.deserializeFromString(fieldName), fieldValue); diff --git a/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableObjectTypeDefinition.java b/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableObjectTypeDefinition.java index 0805cefba27..4c9f1e59986 100644 --- a/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableObjectTypeDefinition.java +++ b/infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/types/DeserializableObjectTypeDefinition.java @@ -66,7 +66,7 @@ public TObject deserialize(final JsonParser p) throws IOException { } final Set presentFields = new HashSet<>(); for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) { - String fieldName = p.getCurrentName(); + String fieldName = p.currentName(); p.nextToken(); final DeserializableFieldDefinition fieldDefinition = deserializableFields.get(fieldName);