Skip to content

Commit 9329742

Browse files
committed
refactor: update fromJson method to use JsonUtils for JSON parsing
1 parent d05fee7 commit 9329742

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/setting/UserSettings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import javafx.beans.property.*;
2424
import javafx.collections.FXCollections;
2525
import javafx.collections.ObservableSet;
26+
import org.jackhuang.hmcl.util.gson.JsonUtils;
2627
import org.jackhuang.hmcl.util.gson.ObservableSetting;
2728
import org.jetbrains.annotations.NotNullByDefault;
2829
import org.jetbrains.annotations.Nullable;
@@ -38,9 +39,8 @@ public final class UserSettings extends ObservableSetting {
3839
///
3940
/// @param json the JSON content to parse
4041
/// @return the parsed settings, or {@code null} when the JSON value is {@code null}
41-
@Nullable
42-
public static UserSettings fromJson(String json) throws JsonParseException {
43-
return LauncherSettings.SETTINGS_GSON.fromJson(json, UserSettings.class);
42+
public static @Nullable UserSettings fromJson(String json) throws JsonParseException {
43+
return JsonUtils.fromJson(LauncherSettings.SETTINGS_GSON, json, UserSettings.class);
4444
}
4545

4646
/// Creates empty user settings with default values.

0 commit comments

Comments
 (0)