Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C95EE200B9E for ; Fri, 23 Sep 2016 14:05:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C81A9160AC2; Fri, 23 Sep 2016 12:05:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 20BEF160ACA for ; Fri, 23 Sep 2016 14:05:13 +0200 (CEST) Received: (qmail 83927 invoked by uid 500); 23 Sep 2016 12:05:13 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 83911 invoked by uid 99); 23 Sep 2016 12:05:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2016 12:05:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1A41CDFC55; Fri, 23 Sep 2016 12:05:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cshannon@apache.org To: commits@activemq.apache.org Date: Fri, 23 Sep 2016 12:05:13 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] activemq git commit: https://issues.apache.org/jira/browse/AMQ-6434 archived-at: Fri, 23 Sep 2016 12:05:14 -0000 Repository: activemq Updated Branches: refs/heads/activemq-5.14.x d3b86e77d -> 8bde32a07 https://issues.apache.org/jira/browse/AMQ-6434 Rewriting logic in finally block of PooledTaskRunner to avoid using a return statement (cherry picked from commit f25e7ab47f1bed223e30fc85afbe43ba1f4c93e6) Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/a80f7ccb Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/a80f7ccb Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/a80f7ccb Branch: refs/heads/activemq-5.14.x Commit: a80f7ccbe1c0e60c3aa668b33e4dbdc3dbb21128 Parents: d3b86e7 Author: Christopher L. Shannon (cshannon) Authored: Fri Sep 23 07:50:12 2016 -0400 Committer: Christopher L. Shannon (cshannon) Committed: Fri Sep 23 08:04:30 2016 -0400 ---------------------------------------------------------------------- .../activemq/thread/PooledTaskRunner.java | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/a80f7ccb/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); + } } }