From f25e7ab47f1bed223e30fc85afbe43ba1f4c93e6 Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Fri, 23 Sep 2016 07:50:12 -0400 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-6434 Rewriting logic in finally block of PooledTaskRunner to avoid using a return statement --- .../activemq/thread/PooledTaskRunner.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java b/activemq-client/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java index 2425bc8217..c8dc9d7a4e 100644 --- a/activemq-client/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java +++ b/activemq-client/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java @@ -142,17 +142,16 @@ class PooledTaskRunner implements TaskRunner { if (shutdown) { queued = false; runable.notifyAll(); - return; - } + } else { + // If we could not iterate all the items + // then we need to re-queue. + if (!done) { + queued = true; + } - // If we could not iterate all the items - // then we need to re-queue. - if (!done) { - queued = true; - } - - if (queued) { - executor.execute(runable); + if (queued) { + executor.execute(runable); + } } }