Skip to content

Commit

Permalink
ZOOKEEPER-3760: remove a useless throwing CliException
Browse files Browse the repository at this point in the history
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 <lingjinjiang@gmail.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org>

Closes apache#1286 from lingjinjiang/master
  • Loading branch information
lingjinjiang authored and RokLenarcic committed Aug 31, 2022
1 parent c08d547 commit 4e501e7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ protected void connectToZK(String newHost) throws InterruptedException, IOExcept
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();
}
Expand All @@ -304,7 +304,7 @@ public ZooKeeperMain(ZooKeeper zk) {
this.zk = zk;
}

void run() throws CliException, IOException, InterruptedException {
void run() throws IOException, InterruptedException {
if (cl.getCommand() == null) {
System.out.println("Welcome to ZooKeeper!");

Expand Down Expand Up @@ -353,7 +353,7 @@ void run() throws CliException, IOException, InterruptedException {
ServiceUtils.requestSystemExit(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);
Expand All @@ -362,7 +362,7 @@ public void executeLine(String line) throws CliException, InterruptedException,
}
}

protected boolean processCmd(MyCommandOptions co) throws CliException, IOException, InterruptedException {
protected boolean processCmd(MyCommandOptions co) throws IOException, InterruptedException {
boolean watch = false;
try {
watch = processZKCmd(co);
Expand Down

0 comments on commit 4e501e7

Please sign in to comment.