From: Tom Pantelis Date: Wed, 21 Dec 2016 10:51:39 +0000 (-0500) Subject: BUG-7033: Follow-up to address prior comments X-Git-Tag: release/carbon~341 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=3ed71a2888cb0e38096d9bf15b78213948d1f328 BUG-7033: Follow-up to address prior comments Follow-up patch to address the 2 comments in https://git.opendaylight.org/gerrit/#/c/49384/ that were made after merge.. Change-Id: Id9864d89637e72961fc1a259f25d541edb1b46dc Signed-off-by: Tom Pantelis --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java index 9d65d993bb..31198b98f2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java @@ -537,8 +537,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { } public Collection getAndClearPendingTransactions() { - Collection ret = new ArrayList<>(pendingTransactions.size() + pendingCommits.size() - + pendingFinishCommits.size()); + Collection ret = new ArrayList<>(getQueueSize()); for (CommitEntry entry: pendingFinishCommits) { ret.add(entry.cohort); @@ -908,7 +907,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { return true; } else { - newTip = MoreObjects.firstNonNull(e.cohort.getCandidate(), dataTree); + newTip = MoreObjects.firstNonNull(e.cohort.getCandidate(), newTip); } }