[
https://issues.apache.org/jira/browse/ARTEMIS-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777454#comment-16777454
]
ASF subversion and git services commented on ARTEMIS-2183:
----------------------------------------------------------
Commit a1d10c02f99c00527b48e0d17ab8ee5766319999 in activemq-artemis's branch
refs/heads/master from Otavio R. Piske
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=a1d10c0 ]
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
> 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: 5h
> 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)