activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6434
Date Fri, 23 Sep 2016 11:51:38 GMT
Repository: activemq
Updated Branches:
  refs/heads/master d4c7cce7d -> f25e7ab47


https://issues.apache.org/jira/browse/AMQ-6434

Rewriting logic in finally block of PooledTaskRunner to avoid using a
return statement


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f25e7ab4
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f25e7ab4
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f25e7ab4

Branch: refs/heads/master
Commit: f25e7ab47f1bed223e30fc85afbe43ba1f4c93e6
Parents: d4c7cce
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Fri Sep 23 07:50:12 2016 -0400
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Fri Sep 23 07:51:11 2016 -0400

----------------------------------------------------------------------
 .../activemq/thread/PooledTaskRunner.java       | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f25e7ab4/activemq-client/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
----------------------------------------------------------------------
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 2425bc8..c8dc9d7 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;
-                }
-
-                // If we could not iterate all the items
-                // then we need to re-queue.
-                if (!done) {
-                    queued = true;
-                }
-
-                if (queued) {
-                    executor.execute(runable);
+                } else {
+                    // If we could not iterate all the items
+                    // then we need to re-queue.
+                    if (!done) {
+                        queued = true;
+                    }
+
+                    if (queued) {
+                        executor.execute(runable);
+                    }
                 }
 
             }


Mime
View raw message