[AMQ-7463] Use ConcurrentHashMap in client connection state to avoid ConcurrentModificationException

This commit is contained in:
anushaCoder 2020-04-10 15:39:16 +05:30 committed by jbonofre
parent 0fd8e52137
commit a5e70fa2d7
1 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ public class ConnectionState {
private final List<DestinationInfo> tempDestinations = Collections.synchronizedList(new ArrayList<DestinationInfo>());
private final AtomicBoolean shutdown = new AtomicBoolean(false);
private boolean connectionInterruptProcessingComplete = true;
private HashMap<ConsumerId, ConsumerInfo> recoveringPullConsumers;
private ConcurrentMap<ConsumerId, ConsumerInfo> recoveringPullConsumers;
public ConnectionState(ConnectionInfo info) {
this.info = info;
@ -146,7 +146,7 @@ public class ConnectionState {
public Map<ConsumerId, ConsumerInfo> getRecoveringPullConsumers() {
if (recoveringPullConsumers == null) {
recoveringPullConsumers = new HashMap<ConsumerId, ConsumerInfo>();
recoveringPullConsumers = new ConcurrentHashMap<ConsumerId, ConsumerInfo>();
}
return recoveringPullConsumers;
}