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 9772C200BD8 for ; Wed, 7 Dec 2016 10:20:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 96342160AFD; Wed, 7 Dec 2016 09:20:35 +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 E0276160B0A for ; Wed, 7 Dec 2016 10:20:34 +0100 (CET) Received: (qmail 51691 invoked by uid 500); 7 Dec 2016 09:20:34 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 51682 invoked by uid 99); 7 Dec 2016 09:20:34 -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; Wed, 07 Dec 2016 09:20:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 105DCE0159; Wed, 7 Dec 2016 09:20:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: ignite-1.8 drop Date: Wed, 7 Dec 2016 09:20:34 +0000 (UTC) archived-at: Wed, 07 Dec 2016 09:20:35 -0000 Repository: ignite Updated Branches: refs/heads/ignite-1.8-drop2 15233cb96 -> df0bc5353 ignite-1.8 drop Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/df0bc535 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/df0bc535 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/df0bc535 Branch: refs/heads/ignite-1.8-drop2 Commit: df0bc53539c7970c0f529e817d6eaaa03c613b34 Parents: 15233cb Author: sboikov Authored: Wed Dec 7 12:20:27 2016 +0300 Committer: sboikov Committed: Wed Dec 7 12:20:27 2016 +0300 ---------------------------------------------------------------------- .../cache/distributed/dht/GridDhtGetFuture.java | 2 +- .../near/GridNearOptimisticTxPrepareFuture.java | 3 ++- .../internal/util/future/GridCompoundFuture.java | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/df0bc535/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index d2a3b3c..d2eab5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -275,7 +275,7 @@ public final class GridDhtGetFuture extends GridCompoundIdentityFuture extends GridFutureAdapter implements Ig @SuppressWarnings("unchecked") public final Collection> futures() { synchronized (sync) { - if(futs == null) + if (futs == null) return Collections.emptyList(); if (futs instanceof IgniteInternalFuture) @@ -313,6 +313,7 @@ public class GridCompoundFuture extends GridFutureAdapter implements Ig /** * @return Futures size. */ + @SuppressWarnings("unchecked") protected final int futuresCountNoLock() { assert Thread.holdsLock(sync); @@ -328,13 +329,21 @@ public class GridCompoundFuture extends GridFutureAdapter implements Ig /** * @return Futures size. */ - @SuppressWarnings("unchecked") - protected final int futuresCount() { + private int futuresCount() { synchronized (sync) { return futuresCountNoLock(); } } + /** + * @return {@code True} if has at least one future. + */ + protected final boolean hasFutures() { + synchronized (sync) { + return futs != null; + } + } + /** {@inheritDoc} */ @Override public String toString() { return S.toString(GridCompoundFuture.class, this,