Repository: accumulo
Updated Branches:
  refs/heads/1.8 cda493bd5 -> 7dc726e07
  refs/heads/master 434a88a3e -> 795487392


ACCUMULO-4013 Remove assignment in condition

Fix compiler warning about boolean assignment in condition.
Move assignment outside of condition to be more explicit that both
values matter.


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

Branch: refs/heads/1.8
Commit: 7dc726e07fe1742f73878b9f9d21314c0f59f0c0
Parents: cda493b
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Sat Aug 13 22:16:44 2016 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Sat Aug 13 22:16:44 2016 -0400

----------------------------------------------------------------------
 .../apache/accumulo/server/init/Initialize.java    | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7dc726e0/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
----------------------------------------------------------------------
diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java 
b/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
index d92392f..cc79d05 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
@@ -575,14 +575,17 @@ public class Initialize implements KeywordExecutable {
       if (opts.clearInstanceName) {
         exists = false;
         break;
+      } else {
         // ACCUMULO-4401 setting exists=false is just as important as setting 
it to true
-      } else if (exists = zoo.exists(instanceNamePath)) {
-        String decision = getConsoleReader().readLine("Instance name \"" + 
instanceName + "\" exists. Delete existing entry from zookeeper? [Y/N] : ");
-        if (decision == null)
-          System.exit(0);
-        if (decision.length() == 1 && 
decision.toLowerCase(Locale.ENGLISH).charAt(0) == 'y') {
-          opts.clearInstanceName = true;
-          exists = false;
+        exists = zoo.exists(instanceNamePath);
+        if (exists) {
+          String decision = getConsoleReader().readLine("Instance name \"" + 
instanceName + "\" exists. Delete existing entry from zookeeper? [Y/N] : ");
+          if (decision == null)
+            System.exit(0);
+          if (decision.length() == 1 && 
decision.toLowerCase(Locale.ENGLISH).charAt(0) == 'y') {
+            opts.clearInstanceName = true;
+            exists = false;
+          }
         }
       }
     } while (exists);

Reply via email to