You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/03/29 23:57:26 UTC

[pulsar] branch master updated: Remove the exception which will never be thrown (#3942)

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

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 86438db  Remove the exception which will never be thrown (#3942)
86438db is described below

commit 86438dbdeef7605528120dcfe83e5fd60b16efd0
Author: Like <li...@163.com>
AuthorDate: Sat Mar 30 07:57:22 2019 +0800

    Remove the exception which will never be thrown (#3942)
---
 .../main/java/org/apache/pulsar/client/cli/PulsarClientTool.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/PulsarClientTool.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/PulsarClientTool.java
index 122f89d..dabfcbd 100644
--- a/pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/PulsarClientTool.java
+++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/PulsarClientTool.java
@@ -22,7 +22,6 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 import java.io.FileInputStream;
-import java.net.MalformedURLException;
 import java.util.Arrays;
 import java.util.Properties;
 
@@ -65,7 +64,7 @@ public class PulsarClientTool {
     CmdProduce produceCommand;
     CmdConsume consumeCommand;
 
-    public PulsarClientTool(Properties properties) throws MalformedURLException {
+    public PulsarClientTool(Properties properties) {
         this.serviceURL = StringUtils.isNotBlank(properties.getProperty("brokerServiceUrl"))
                 ? properties.getProperty("brokerServiceUrl") : properties.getProperty("webServiceUrl");
         // fallback to previous-version serviceUrl property to maintain backward-compatibility
@@ -90,7 +89,7 @@ public class PulsarClientTool {
         commandParser.addCommand("consume", consumeCommand);
     }
 
-    private void updateConfig() throws UnsupportedAuthenticationException, MalformedURLException {
+    private void updateConfig() throws UnsupportedAuthenticationException {
         ClientBuilder clientBuilder = PulsarClient.builder();
         Authentication authentication = null;
         if (isNotBlank(this.authPluginClassName)) {
@@ -121,10 +120,6 @@ public class PulsarClientTool {
             try {
                 this.updateConfig(); // If the --url, --auth-plugin, or --auth-params parameter are not specified,
                                      // it will default to the values passed in by the constructor
-            } catch (MalformedURLException mue) {
-                System.out.println("Unable to parse URL " + this.serviceURL);
-                commandParser.usage();
-                return -1;
             } catch (UnsupportedAuthenticationException exp) {
                 System.out.println("Failed to load an authentication plugin");
                 commandParser.usage();