From bcb6943e67dc0814f93197118af408c38c2b9fde Mon Sep 17 00:00:00 2001 From: 01000010 <71404592+aivruu@users.noreply.github.com> Date: Sat, 1 Jun 2024 13:22:21 -0400 Subject: [PATCH] chore(deserialization-provider): Remove unnecessary switch block for only two codec types --- .../qeklydev/downloader/codec/DeserializationProvider.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/qeklydev/downloader/codec/DeserializationProvider.java b/src/main/java/me/qeklydev/downloader/codec/DeserializationProvider.java index 077e8be..53462c2 100644 --- a/src/main/java/me/qeklydev/downloader/codec/DeserializationProvider.java +++ b/src/main/java/me/qeklydev/downloader/codec/DeserializationProvider.java @@ -103,9 +103,8 @@ public static class Builder { if (this.jsonBody == null || this.codecType == null) { throw new IllegalStateException("Json body or codec type for the deserialization have not been specified!"); } - return switch (this.codecType) { - case RELEASE, REPOSITORY -> GSON_PROVIDER.fromJson(this.jsonBody, this.codecType.typeClass()); - }; + // Should never be null because codec-type specified always is valid. + return GSON_PROVIDER.fromJson(this.jsonBody, this.codecType.typeClass()); } }