Technoboy- commented on code in PR #20821:
URL: https://github.com/apache/pulsar/pull/20821#discussion_r1271896430
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/ClusterDataImpl.java:
##########
@@ -412,7 +412,20 @@ public ClusterDataImpl build() {
*
* @throws IllegalArgumentException exist illegal property.
*/
- public void checkPropertiesIfPresent() throws IllegalArgumentException {
+ public void checkPropertiesIfPresent() throws IllegalArgumentException {
+ boolean hasServiceUrl = getServiceUrl() != null;
+ boolean hasServiceUrlTls = getServiceUrlTls() != null;
+ boolean hasBrokerServiceUrl = getBrokerServiceUrl() != null;
+ boolean hasBrokerServiceUrlTls = getBrokerServiceUrlTls() != null;
+
+ if (!hasServiceUrl && !hasServiceUrlTls) {
+ throw new IllegalArgumentException("Atleast one of ServiceUrl
or ServiceUrlTls must be set.");
Review Comment:
Also I think we can use `StringUtils.isEmpty(getServiceUrl()) &&
StringUtils.isEmpty(getServiceUrlTls())` to reduce the codes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]