mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-24 17:11:30 +01:00
Removed code smell.
This commit is contained in:
parent
458a4a19f5
commit
a88b241633
@ -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()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user