diff --git a/java/statestore-commit/src/main/java/sleeper/commit/StateStoreCommitRequestDeserialiser.java b/java/statestore-commit/src/main/java/sleeper/commit/StateStoreCommitRequestDeserialiser.java index 6fb0ea2310..8a4deb2dd0 100644 --- a/java/statestore-commit/src/main/java/sleeper/commit/StateStoreCommitRequestDeserialiser.java +++ b/java/statestore-commit/src/main/java/sleeper/commit/StateStoreCommitRequestDeserialiser.java @@ -48,7 +48,6 @@ public class StateStoreCommitRequestDeserialiser { private final Gson gson; public StateStoreCommitRequestDeserialiser(TablePropertiesProvider tablePropertiesProvider) { - gson = GsonConfig.standardBuilder() .registerTypeAdapter(CompactionJob.class, new CompactionJobJsonSerDe()) .registerTypeAdapter(StateStoreCommitRequest.class, new WrapperDeserialiser()) @@ -122,10 +121,7 @@ private SplitPartitionDeserialiser(TablePropertiesProvider tablePropertiesProvid @Override public SplitPartitionCommitRequest deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException { - if (!jsonElement.isJsonObject()) { - throw new JsonParseException("Expected JsonObject, got " + jsonElement); - } - JsonObject json = (JsonObject) jsonElement; + JsonObject json = jsonElement.getAsJsonObject(); String tableId = json.get(TABLE_ID).getAsString(); PartitionJsonSerDe partitionJsonSerDe = new PartitionJsonSerDe(tablePropertiesProvider.getById(tableId).getSchema());