8342083: Make a few fields in FileSystemPreferences final

Reviewed-by: jpai, bpb
This commit is contained in:
Andrey Turbanov 2024-10-26 17:59:15 +00:00
parent 762a573ef1
commit 0e3fc93dfb

View File

@ -450,7 +450,7 @@ class FileSystemPreferences extends AbstractPreferences {
changeLog.get(i).replay();
}
private static Timer syncTimer = new Timer(true); // Daemon Thread
private static final Timer syncTimer = new Timer(true); // Daemon Thread
static {
addShutdownHook();
@ -540,7 +540,7 @@ class FileSystemPreferences extends AbstractPreferences {
}
});
if (newNode) {
// These 2 things guarantee node will get wrtten at next flush/sync
// These 2 things guarantee node will get written at next flush/sync
prefsCache = new TreeMap<>();
nodeCreate = new NodeCreate();
changeLog.add(nodeCreate);
@ -1008,12 +1008,12 @@ class FileSystemPreferences extends AbstractPreferences {
* Initial time between lock attempts, in ms. The time is doubled
* after each failing attempt (except the first).
*/
private static int INIT_SLEEP_TIME = 50;
private static final int INIT_SLEEP_TIME = 50;
/**
* Maximum number of lock attempts.
*/
private static int MAX_ATTEMPTS = 5;
private static final int MAX_ATTEMPTS = 5;
/**
* Release the appropriate file lock (user or system).