This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new cf26103  ARTEMIS-2571 Remove synchronization of 
ActiveMQServerImpl#getSessions()
     new 9e2705c  This closes #2913
cf26103 is described below

commit cf26103bb24f51a02acc776f1b8077fa92307853
Author: Sebastian Thomschke <[email protected]>
AuthorDate: Tue Dec 10 10:41:39 2019 +0100

    ARTEMIS-2571 Remove synchronization of ActiveMQServerImpl#getSessions()
---
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index f1e79c2..06ee52b 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -295,7 +295,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
    private FileStoreMonitor fileStoreMonitor;
 
-   private final Map<String, ServerSession> sessions = new 
ConcurrentHashMap<>();
+   private final ConcurrentMap<String, ServerSession> sessions = new 
ConcurrentHashMap<>();
 
    private final Semaphore activationLock = new Semaphore(1);
    /**
@@ -1643,7 +1643,7 @@ public class ActiveMQServerImpl implements ActiveMQServer 
{
    }
 
    @Override
-   public synchronized List<ServerSession> getSessions(final String 
connectionID) {
+   public List<ServerSession> getSessions(final String connectionID) {
       Set<Entry<String, ServerSession>> sessionEntries = sessions.entrySet();
       List<ServerSession> matchingSessions = new ArrayList<>();
       for (Entry<String, ServerSession> sessionEntry : sessionEntries) {
@@ -1656,7 +1656,7 @@ public class ActiveMQServerImpl implements ActiveMQServer 
{
    }
 
    @Override
-   public synchronized Set<ServerSession> getSessions() {
+   public Set<ServerSession> getSessions() {
       return new HashSet<>(sessions.values());
    }
 

Reply via email to