Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant null check for getInternalListener #12474

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static String getAppliedAdvertisedAddress(ServiceConfiguration configurat

/**
* Gets the internal advertised listener for broker-to-broker communication.
* @return an advertised listener
* @return a non-null advertised listener
*/
public static AdvertisedListener getInternalListener(ServiceConfiguration config) {
Map<String, AdvertisedListener> result = MultipleListenerValidator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ public TransactionBufferClient getTransactionBufferClient() {
*/
protected String brokerUrl(ServiceConfiguration config) {
AdvertisedListener internalListener = ServiceConfigurationUtils.getInternalListener(config);
return internalListener != null && internalListener.getBrokerServiceUrl() != null
return internalListener.getBrokerServiceUrl() != null
? internalListener.getBrokerServiceUrl().toString() : null;
}

Expand All @@ -1425,7 +1425,7 @@ public static String brokerUrl(String host, int port) {
*/
public String brokerUrlTls(ServiceConfiguration config) {
AdvertisedListener internalListener = ServiceConfigurationUtils.getInternalListener(config);
return internalListener != null && internalListener.getBrokerServiceUrlTls() != null
return internalListener.getBrokerServiceUrlTls() != null
? internalListener.getBrokerServiceUrlTls().toString() : null;
}

Expand Down