From 207d0989612c70dadb7d333cbedced06b9cf3548 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Fri, 2 Oct 2020 15:50:03 -0500 Subject: [PATCH] Fix rename mistakes --- .../common/persistence/PersistenceManager.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/bisq/common/persistence/PersistenceManager.java b/common/src/main/java/bisq/common/persistence/PersistenceManager.java index 189b025913a..b0772c72eb8 100644 --- a/common/src/main/java/bisq/common/persistence/PersistenceManager.java +++ b/common/src/main/java/bisq/common/persistence/PersistenceManager.java @@ -94,7 +94,7 @@ public static void flushAllDataToDisk(ResultHandler completeHandler) { // For Priority.HIGH data we want to write to disk in any case to be on the safe side if we might have missed // a requestPersistence call after an important state update. Those are usually rather small data stores. // Otherwise we only persist if requestPersistence was called since the last persist call. - if (persistenceManager.SOURCE.flushAtShutDown || persistenceManager.persistenceRequested) { + if (persistenceManager.source.flushAtShutDown || persistenceManager.persistenceRequested) { // We don't know from which thread we are called so we map back to user thread when calling persistNow UserThread.execute(() -> { // We always get our completeHandler called even if exceptions happen. In case a file write fails @@ -160,7 +160,7 @@ public enum Source { private File storageFile; private T persistable; private String fileName; - private Source SOURCE = SOURCE.PRIVATE_LOW_PRIO; + private Source source = Source.PRIVATE_LOW_PRIO; private Path usedTempFilePath; private volatile boolean persistenceRequested; @Nullable @@ -185,14 +185,14 @@ public PersistenceManager(@Named(Config.STORAGE_DIR) File dir, // API /////////////////////////////////////////////////////////////////////////////////////////// - public void initialize(T persistable, Source SOURCE) { - this.initialize(persistable, persistable.getDefaultStorageFileName(), SOURCE); + public void initialize(T persistable, Source sourcce) { + this.initialize(persistable, persistable.getDefaultStorageFileName(), sourcce); } - public void initialize(T persistable, String fileName, Source SOURCE) { + public void initialize(T persistable, String fileName, Source sourcce) { this.persistable = persistable; this.fileName = fileName; - this.SOURCE = SOURCE; + this.source = sourcce; storageFile = new File(dir, fileName); ALL_PERSISTENCE_MANAGERS.put(fileName, this); } @@ -268,7 +268,7 @@ public void requestPersistence() { timer = UserThread.runPeriodically(() -> { persistNow(null); UserThread.execute(() -> timer = null); - }, SOURCE.delayInSec, TimeUnit.SECONDS); + }, source.delayInSec, TimeUnit.SECONDS); } } @@ -299,7 +299,7 @@ public void writeToDisk(protobuf.PersistableEnvelope serialized, @Nullable Runna try { // Before we write we backup existing file - FileUtil.rollingBackup(dir, fileName, SOURCE.getNumMaxBackupFiles()); + FileUtil.rollingBackup(dir, fileName, source.getNumMaxBackupFiles()); if (!dir.exists() && !dir.mkdir()) log.warn("make dir failed {}", fileName); @@ -370,7 +370,7 @@ public String toString() { ",\n dir=" + dir + ",\n storageFile=" + storageFile + ",\n persistable=" + persistable + - ",\n priority=" + SOURCE + + ",\n priority=" + source + ",\n usedTempFilePath=" + usedTempFilePath + ",\n persistenceRequested=" + persistenceRequested + "\n}";