Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5AAEB105F1 for ; Wed, 9 Sep 2015 18:35:28 +0000 (UTC) Received: (qmail 69611 invoked by uid 500); 9 Sep 2015 18:35:28 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 69549 invoked by uid 500); 9 Sep 2015 18:35:28 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 69533 invoked by uid 99); 9 Sep 2015 18:35:28 -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, 09 Sep 2015 18:35:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CFE25DFF8A; Wed, 9 Sep 2015 18:35:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Date: Wed, 09 Sep 2015 18:35:27 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] curator git commit: no more need for reflection. there is a getZooKeeperServer() method Repository: curator Updated Branches: refs/heads/CURATOR-3.0 d71f49bf5 -> 73b05aac9 no more need for reflection. there is a getZooKeeperServer() method Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d110cbb6 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d110cbb6 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d110cbb6 Branch: refs/heads/CURATOR-3.0 Commit: d110cbb60ce96d4030e0e6da5accd64baef62eca Parents: d71f49b Author: randgalt Authored: Wed Sep 9 13:34:51 2015 -0500 Committer: randgalt Committed: Wed Sep 9 13:34:51 2015 -0500 ---------------------------------------------------------------------- .../java/org/apache/curator/test/TestingZooKeeperMain.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/d110cbb6/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java ---------------------------------------------------------------------- diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java index 7d0c6a1..3d0c341 100644 --- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java +++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java @@ -188,15 +188,13 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep private ZooKeeperServer getZooKeeperServer(ServerCnxnFactory cnxnFactory) throws Exception { - Field zkServerField = ServerCnxnFactory.class.getDeclaredField("zkServer"); - zkServerField.setAccessible(true); ZooKeeperServer zkServer; // Wait until the zkServer field is non-null long startTime = System.currentTimeMillis(); do { - zkServer = (ZooKeeperServer)zkServerField.get(cnxnFactory); + zkServer = cnxnFactory.getZooKeeperServer(); if ( zkServer == null ) { try @@ -210,7 +208,7 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep } } } - while ( (zkServer == null) && ((System.currentTimeMillis() - startTime) < MAX_WAIT_MS) ); + while ( (zkServer == null) && ((System.currentTimeMillis() - startTime) <= MAX_WAIT_MS) ); return zkServer; }