You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/02/26 01:11:13 UTC

[activemq-artemis] 01/03: ARTEMIS-2183 Useless statement in public synchronized List

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

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

commit a1d10c02f99c00527b48e0d17ab8ee5766319999
Author: Otavio R. Piske <an...@gmail.com>
AuthorDate: Mon Feb 25 19:53:41 2019 +0100

    ARTEMIS-2183 Useless statement in public synchronized List
    
    Ensures that the returned list returns the refsToAck list instead of
    trying to add all items of itself
    
    This closes 2566
---
 .../org/apache/activemq/artemis/core/server/impl/RefsOperation.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
index 3d8bdd6..6d21be2 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
@@ -191,7 +191,11 @@ public class RefsOperation extends TransactionOperationAbstract {
    @Override
    public synchronized List<MessageReference> getRelatedMessageReferences() {
       List<MessageReference> listRet = new LinkedList<>();
-      listRet.addAll(listRet);
+
+      if (refsToAck != null && !refsToAck.isEmpty()) {
+         listRet.addAll(refsToAck);
+      }
+
       return listRet;
    }