You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "clebert suconic (JIRA)" <ji...@apache.org> on 2019/02/25 22:24:00 UTC

[jira] [Updated] (ARTEMIS-2183) RefsOperation::getDeliveringMessages is broken

     [ https://issues.apache.org/jira/browse/ARTEMIS-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

clebert suconic updated ARTEMIS-2183:
-------------------------------------
    Summary: RefsOperation::getDeliveringMessages is broken  (was: Useless statement in public synchronized List<MessageReference> RefsOperation#getRelatedMessageReferences())

> RefsOperation::getDeliveringMessages is broken
> ----------------------------------------------
>
>                 Key: ARTEMIS-2183
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2183
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>            Reporter: Jiri Daněk
>            Priority: Trivial
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> {code}
>    @Override
>    public synchronized List<MessageReference> getRelatedMessageReferences() {
>       List<MessageReference> listRet = new LinkedList<>();
>       listRet.addAll(listRet);  // 🐟
>       return listRet;
>    }
> {code}
> https://github.com/apache/activemq-artemis/blob/master/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java#L184
> The method returns empty list, which may be wrong (looking at the method name). There is absolutely nothing gained by adding content of empty inst into itself, as in {{listRet.addAll(listRet)}}.
> Doing the addAll thing can be an error under ErrorProne compiler.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)