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

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

Jiri Danek created ARTEMIS-993:
----------------------------------

             Summary: 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
            Priority: Trivial


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)