Removed code smell.

This commit is contained in:
tastybento 2019-07-10 08:28:23 -07:00
parent 458a4a19f5
commit a88b241633

View File

@ -166,14 +166,14 @@ public class JSONDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
String toStore = getGson().toJson(instance); String toStore = getGson().toJson(instance);
if (plugin.isEnabled()) { if (plugin.isEnabled()) {
// Async // Async
processQueue.add(() -> store(instance, toStore, file, tableFolder, fileName)); processQueue.add(() -> store(toStore, file, tableFolder, fileName));
} else { } else {
// Sync // Sync
store(instance, toStore, file, tableFolder, fileName); store(toStore, file, tableFolder, fileName);
} }
} }
private void store(T instance, String toStore, File file, File tableFolder, String fileName) { private void store(String toStore, File file, File tableFolder, String fileName) {
try (FileWriter fileWriter = new FileWriter(file)) { try (FileWriter fileWriter = new FileWriter(file)) {
File tmpFile = new File(tableFolder, fileName + ".bak"); File tmpFile = new File(tableFolder, fileName + ".bak");
if (file.exists()) { if (file.exists()) {