Refactor: Rename field

This commit is contained in:
chimp1984 2021-03-06 10:24:58 -05:00
parent 569a2de641
commit ab5b29cd15
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -81,7 +81,7 @@ public class PersistenceManager<T extends PersistableEnvelope> {
///////////////////////////////////////////////////////////////////////////////////////////
public static final Map<String, PersistenceManager<?>> ALL_PERSISTENCE_MANAGERS = new HashMap<>();
private static boolean FLUSH_ALL_DATA_TO_DISK_CALLED = false;
private static boolean flushAllDataToDiskCalled = false;
private static AtomicBoolean allServicesInitialized = new AtomicBoolean(false);
public static void onAllServicesInitialized() {
@ -102,12 +102,12 @@ public class PersistenceManager<T extends PersistableEnvelope> {
// We don't know from which thread we are called so we map to user thread
UserThread.execute(() -> {
if (FLUSH_ALL_DATA_TO_DISK_CALLED) {
if (flushAllDataToDiskCalled) {
log.warn("We got flushAllDataToDisk called again. This can happen in some rare cases. We ignore the repeated call.");
return;
}
FLUSH_ALL_DATA_TO_DISK_CALLED = true;
flushAllDataToDiskCalled = true;
log.info("Start flushAllDataToDisk at shutdown");
AtomicInteger openInstances = new AtomicInteger(ALL_PERSISTENCE_MANAGERS.size());
@ -223,7 +223,7 @@ public class PersistenceManager<T extends PersistableEnvelope> {
}
public void initialize(T persistable, String fileName, Source source) {
if (FLUSH_ALL_DATA_TO_DISK_CALLED) {
if (flushAllDataToDiskCalled) {
log.warn("We have started the shut down routine already. We ignore that initialize call.");
return;
}
@ -289,7 +289,7 @@ public class PersistenceManager<T extends PersistableEnvelope> {
* @param orElse Called if no file exists or reading of file failed.
*/
public void readPersisted(String fileName, Consumer<T> resultHandler, Runnable orElse) {
if (FLUSH_ALL_DATA_TO_DISK_CALLED) {
if (flushAllDataToDiskCalled) {
log.warn("We have started the shut down routine already. We ignore that readPersisted call.");
return;
}
@ -313,7 +313,7 @@ public class PersistenceManager<T extends PersistableEnvelope> {
@Nullable
public T getPersisted(String fileName) {
if (FLUSH_ALL_DATA_TO_DISK_CALLED) {
if (flushAllDataToDiskCalled) {
log.warn("We have started the shut down routine already. We ignore that getPersisted call.");
return null;
}
@ -356,7 +356,7 @@ public class PersistenceManager<T extends PersistableEnvelope> {
///////////////////////////////////////////////////////////////////////////////////////////
public void requestPersistence() {
if (FLUSH_ALL_DATA_TO_DISK_CALLED) {
if (flushAllDataToDiskCalled) {
log.warn("We have started the shut down routine already. We ignore that requestPersistence call.");
return;
}