activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-993) ClientConsumerImpl.java contains unreachable code
Date Fri, 24 Feb 2017 19:37:44 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15883390#comment-15883390
] 

ASF GitHub Bot commented on ARTEMIS-993:
----------------------------------------

GitHub user jbertram opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1047

    ARTEMIS-993 removing unreachable code

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-993

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1047.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1047
    
----
commit 16285ba5486be242f2c701f3bdbdfb770174f5f2
Author: Justin Bertram <jbertram@apache.org>
Date:   2017-02-24T19:36:23Z

    ARTEMIS-993 removing unreachable code

----


> 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
>
> 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)

Mime
View raw message