mirror of https://github.com/apache/activemq.git
Merge pull request #508 from coheigea/AMQ-7440
AMQ-7440 - Fix potential race condition in DiscoveryRegistryServlet
This commit is contained in:
commit
2ec18730c2
|
@ -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