Skip to content

Commit

Permalink
call equals on formatted strings since they will never be null (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsturzl authored Jan 17, 2024
1 parent 7ac60ae commit 62e93cb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ private boolean isLookupMQTTBroker(Pair<InetSocketAddress, InetSocketAddress> pa
String plain = String.format("pulsar://%s:%s", pair.getLeft().getHostName(), pair.getLeft().getPort());
String ssl = String.format("pulsar+ssl://%s:%s", pair.getLeft().getHostName(), pair.getLeft().getPort());
return localBrokerData.getProtocol(protocolHandlerName).isPresent()
&& (localBrokerData.getPulsarServiceUrl().equals(plain)
|| localBrokerData.getPulsarServiceUrlTls().equals(ssl));
&& (plain.equals(localBrokerData.getPulsarServiceUrl())
|| ssl.equals(localBrokerData.getPulsarServiceUrlTls()));
}

@Override
Expand Down

0 comments on commit 62e93cb

Please sign in to comment.