This is an automated email from the ASF dual-hosted git repository.

nkalmar pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new 95852ea  ZOOKEEPER-3760: remove a useless throwing CliException
95852ea is described below

commit 95852ea842980482c6f71a94942c687a378d5a9f
Author: lingjinjiang <[email protected]>
AuthorDate: Thu Mar 26 18:41:57 2020 +0100

    ZOOKEEPER-3760: remove a useless throwing CliException
    
    https://issues.apache.org/jira/browse/ZOOKEEPER-3760
    
    When I upgrade zookeeper from 3.4.13 to 3.5.7 in my application, I find the 
function processCmd in ZooKeeperMain.java throws a CliException which has been 
caught in the function. So I think it can be removed
    
    Author: lingjinjiang <[email protected]>
    
    Reviewers: Enrico Olivelli <[email protected]>, Norbert Kalmar 
<[email protected]>
    
    Closes #1286 from lingjinjiang/master
    
    (cherry picked from commit 2581f71dd97cfda2cf6768c3457b81c7a93b9ef7)
    Signed-off-by: Norbert Kalmar <[email protected]>
---
 .../src/main/java/org/apache/zookeeper/ZooKeeperMain.java     | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java 
b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java
index ccfb92c..0d488ee 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java
@@ -287,9 +287,8 @@ public class ZooKeeperMain {
         }
         zk = new ZooKeeperAdmin(host, 
Integer.parseInt(cl.getOption("timeout")), new MyWatcher(), readOnly);
     }
-    
-    public static void main(String args[]) throws CliException, IOException, 
InterruptedException
-    {
+
+    public static void main(String args[]) throws IOException, 
InterruptedException {
         ZooKeeperMain main = new ZooKeeperMain(args);
         main.run();
     }
@@ -304,7 +303,7 @@ public class ZooKeeperMain {
       this.zk = zk;
     }
 
-    void run() throws CliException, IOException, InterruptedException {
+    void run() throws IOException, InterruptedException {
         if (cl.getCommand() == null) {
             System.out.println("Welcome to ZooKeeper!");
 
@@ -365,7 +364,7 @@ public class ZooKeeperMain {
         System.exit(exitCode);
     }
 
-    public void executeLine(String line) throws CliException, 
InterruptedException, IOException {
+    public void executeLine(String line) throws InterruptedException, 
IOException {
       if (!line.equals("")) {
         cl.parseCommand(line);
         addToHistory(commandCount,line);
@@ -582,7 +581,7 @@ public class ZooKeeperMain {
         return true;
     }
 
-    protected boolean processCmd(MyCommandOptions co) throws CliException, 
IOException, InterruptedException {
+    protected boolean processCmd(MyCommandOptions co) throws IOException, 
InterruptedException {
         boolean watch = false;
         try {
             watch = processZKCmd(co);

Reply via email to