chore: update build.gradle

upgrade io.netty:netty-all from 4.1.52.Final to 4.1.63.Final; optimize imports in JsonUtil
This commit is contained in:
Frank.R.Wu 2021-12-23 21:39:55 +08:00
parent d10337e42b
commit 72878eff91
2 changed files with 4 additions and 5 deletions

View File

@ -29,7 +29,7 @@ dependencies {
api 'berkeleydb:je:3.2.76'
api 'com.fifesoft:rsyntaxtextarea:3.1.3'
api 'commons-io:commons-io:2.11.0'
api 'io.netty:netty-all:4.1.52.Final'
api 'io.netty:netty-all:4.1.63.Final'
api 'org.antlr:antlr4:4.9.2'
api 'commons-codec:commons-codec:1.5'
api 'org.apache.logging.log4j:log4j-core:2.17.0'

View File

@ -1,11 +1,8 @@
package org.bdware.sc.util;
import com.google.gson.*;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.lang.reflect.Type;
public class JsonUtil {
@ -43,9 +40,11 @@ public class JsonUtil {
public static JsonObject parseStringAsJsonObject(String json) {
return JsonParser.parseString(json).getAsJsonObject();
}
public static JsonElement parseString(String json) {
return JsonParser.parseString(json);
}
public static JsonObject parseReaderAsJsonObject(Reader reader) {
return JsonParser.parseReader(reader).getAsJsonObject();
}