Skip to content

Commit

Permalink
undo string utils
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyual committed Sep 8, 2023
1 parent 713ed5b commit f7deeeb
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ public static Map<String, Object> fromJson(String jsonStr, String defaultKey) {
Map<String, Object> result;
JsonElement jsonElement = JsonParser.parseString(jsonStr);
if (jsonElement.isJsonObject()) {
Map<String, Object> resultJson = gson.fromJson(jsonElement, Map.class);
List<Object> list = new ArrayList<>();
list.add(resultJson);
result = new HashMap<>();
result.put(defaultKey, list);
result = gson.fromJson(jsonElement, Map.class);
} else if (jsonElement.isJsonArray()) {
List<Object> list = gson.fromJson(jsonElement, List.class);
result = new HashMap<>();
Expand Down

0 comments on commit f7deeeb

Please sign in to comment.