Skip to content

Commit

Permalink
Combine declaration and assigning into one
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 12, 2024
1 parent 9994c33 commit 59045b8
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ private void load() {
UUID playerUuid = UUID.fromString(playerUuidString);
PlayerProfile profile;

FileReader reader;

try {
reader = new FileReader(playerDataFile);
FileReader reader = new FileReader(playerDataFile);

profile = gson.fromJson(reader, PlayerProfile.class);

Expand Down Expand Up @@ -83,12 +81,10 @@ public void save() {

File file = new File(playerDataFolderPath + File.separator + uuid.toString() + playerDataFilesExtension);

FileWriter writer;

try {
file.createNewFile();

writer = new FileWriter(file);
FileWriter writer = new FileWriter(file);

String json = gson.toJson(profile);

Expand Down

0 comments on commit 59045b8

Please sign in to comment.