From 408da409df251f9f147728af97d2bb2a537e73e5 Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Tue, 11 Jun 2019 11:58:21 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=97=D0=B0=D0=B1=D1=8B=D1=82=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?=20base64=20=D0=B2=20CommonHelper.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/pro/gravit/utils/helper/CommonHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java index d822dcb7..18e4a1de 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java @@ -154,7 +154,7 @@ public static void removeExc(byte[] exclusion) { private static class ByteArrayToBase64TypeAdapter implements JsonSerializer, JsonDeserializer { private static final ByteArrayToBase64TypeAdapter INSTANCE = new ByteArrayToBase64TypeAdapter(); - private static final Map exclusions = new ConcurrentHashMap<>(); + private static final Map exclusions = new ConcurrentHashMap<>(); private final Base64.Decoder decoder = Base64.getUrlDecoder(); private final Base64.Encoder encoder = Base64.getUrlEncoder(); public byte[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { @@ -170,7 +170,7 @@ public byte[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationCon } public JsonElement serialize(byte[] src, Type typeOfSrc, JsonSerializationContext context) { - return new JsonPrimitive(encoder.encodeToString(src)); + return exclusions.getOrDefault(src, new JsonPrimitive(encoder.encodeToString(src))); } } }