mirror of https://github.com/apache/activemq.git
AMQ-7440 - Fix potential race condition in DiscoveryRegistryServlet
This commit is contained in:
parent
c0e7949468
commit
c44be3b0dd
|
@ -49,12 +49,7 @@ public class DiscoveryRegistryServlet extends HttpServlet {
|
|||
}
|
||||
|
||||
private ConcurrentMap<String, Long> getServiceGroup(String group) {
|
||||
ConcurrentMap<String, Long> rc = serviceGroups.get(group);
|
||||
if( rc == null ) {
|
||||
rc = new ConcurrentHashMap<String, Long>();
|
||||
serviceGroups.put(group, rc);
|
||||
}
|
||||
return rc;
|
||||
return serviceGroups.computeIfAbsent(group, k -> new ConcurrentHashMap<String, Long>());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue