You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Martyn Taylor (JIRA)" <ji...@apache.org> on 2017/03/10 13:44:05 UTC

[jira] [Resolved] (ARTEMIS-993) ClientConsumerImpl.java contains unreachable code

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

Martyn Taylor resolved ARTEMIS-993.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

> ClientConsumerImpl.java contains unreachable code
> -------------------------------------------------
>
>                 Key: ARTEMIS-993
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-993
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.0.0
>            Reporter: Jiri Danek
>            Assignee: Justin Bertram
>            Priority: Trivial
>             Fix For: 2.0.0
>
>
> ClientConsumerImpl.java contains code similar to this abbreviated snippet
> {noformat}
> 236            ClientMessageInternal m = null;
> ...
> 239               while ((stopped || (m = buffer.poll()) == null) && !closed && toWait > 0) {
> ...
> 256                  if (m != null) {
> 257                     session.workDone();
> 258                  }
> ...
> {noformat}
> According to static analysis (and I concur), It is logically impossible for {{m != null}} to be true inside the body of the while loop.
> I am not aware of this having any observable effect in terms of incorrect behavior, so I am assigning the lowest priority.
> See the actual code at https://github.com/apache/activemq-artemis/blob/f698a7f8189af7b70160ba18596be371642776bb/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java#L239



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)