From 1641f86b179e6b97bfdcf6a59e9066378987a0d3 Mon Sep 17 00:00:00 2001 From: deepanshu42 Date: Fri, 28 Oct 2022 11:30:20 +0530 Subject: [PATCH] Remove empty username check --- .../src/main/java/com/gojek/mqtt/model/MqttConnectOptions.kt | 1 - .../java/org/eclipse/paho/client/mqttv3/MqttConnectOptions.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mqtt-client/src/main/java/com/gojek/mqtt/model/MqttConnectOptions.kt b/mqtt-client/src/main/java/com/gojek/mqtt/model/MqttConnectOptions.kt index 69592f2f..d90d7c12 100644 --- a/mqtt-client/src/main/java/com/gojek/mqtt/model/MqttConnectOptions.kt +++ b/mqtt-client/src/main/java/com/gojek/mqtt/model/MqttConnectOptions.kt @@ -111,7 +111,6 @@ class MqttConnectOptions private constructor( } fun userName(username: String) = apply { - require(username.isNotEmpty()) { "username cannot be empty" } this.username = username } diff --git a/paho/src/main/java/org/eclipse/paho/client/mqttv3/MqttConnectOptions.java b/paho/src/main/java/org/eclipse/paho/client/mqttv3/MqttConnectOptions.java index 767a77a3..1d2e6044 100644 --- a/paho/src/main/java/org/eclipse/paho/client/mqttv3/MqttConnectOptions.java +++ b/paho/src/main/java/org/eclipse/paho/client/mqttv3/MqttConnectOptions.java @@ -162,7 +162,7 @@ public void setUserName(String userName) { if ((userName != null) && (userName.trim().equals(""))) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Username is empty"); } this.userName = userName; }