Fixed synchronization on a non-final field

This commit is contained in:
AlphaX-Projects 2024-06-29 12:13:12 +02:00
parent 806dc6d056
commit 64537ad705
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ public class ChatNotifier {
void notify(ChatTransactionData chatTransactionData); void notify(ChatTransactionData chatTransactionData);
} }
private Map<Session, Listener> listenersBySession = new HashMap<>(); private final Map<Session, Listener> listenersBySession = new HashMap<>();
private ChatNotifier() { private ChatNotifier() {
} }

View File

@ -43,7 +43,7 @@ public class ArbitraryDataFileManager extends Thread {
/** /**
* Map to keep track of hashes that we might need to relay * Map to keep track of hashes that we might need to relay
*/ */
public List<ArbitraryRelayInfo> arbitraryRelayMap = Collections.synchronizedList(new ArrayList<>()); public final List<ArbitraryRelayInfo> arbitraryRelayMap = Collections.synchronizedList(new ArrayList<>());
/** /**
* List to keep track of any arbitrary data file hash responses * List to keep track of any arbitrary data file hash responses
@ -53,7 +53,7 @@ public class ArbitraryDataFileManager extends Thread {
/** /**
* List to keep track of peers potentially available for direct connections, based on recent requests * List to keep track of peers potentially available for direct connections, based on recent requests
*/ */
private List<ArbitraryDirectConnectionInfo> directConnectionInfo = Collections.synchronizedList(new ArrayList<>()); private final List<ArbitraryDirectConnectionInfo> directConnectionInfo = Collections.synchronizedList(new ArrayList<>());
/** /**
* Map to keep track of peers requesting QDN data that we hold. * Map to keep track of peers requesting QDN data that we hold.