Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-993

ClientConsumerImpl.java contains unreachable code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Broker
    • None

    Description

      ClientConsumerImpl.java contains code similar to this abbreviated snippet

      236            ClientMessageInternal m = null;
      ...
      239               while ((stopped || (m = buffer.poll()) == null) && !closed && toWait > 0) {
      ...
      256                  if (m != null) {
      257                     session.workDone();
      258                  }
      ...
      

      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

      Attachments

        Issue Links

          Activity

            People

              jbertram Justin Bertram
              jdanek Jiri Daněk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: