FileConfigStore: Move function returns outside try blocks

This makes more clear what things can throw exceptions, and the
functions' control flow.

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2018-01-07 20:33:39 -06:00
parent 0ab3e29432
commit 16c0b5b15a

View File

@ -38,8 +38,8 @@ public final class FileConfigStore implements ConfigStore {
}
try (FileOutputStream stream = new FileOutputStream(file, false)) {
stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
return config;
}
return config;
}
@Override
@ -78,7 +78,7 @@ public final class FileConfigStore implements ConfigStore {
}
try (FileOutputStream stream = new FileOutputStream(file, false)) {
stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
}
return config;
}
}
}