tisonkun commented on code in PR #18589:
URL: https://github.com/apache/pulsar/pull/18589#discussion_r1031192715
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/ManagedLedgerClientFactory.java:
##########
@@ -154,7 +155,7 @@ public void close() throws IOException {
// factory, however that might be introducing more unknowns.
log.warn("Encountered exceptions on closing bookkeeper
client", ree);
}
- if (bkEnsemblePolicyToBkClientMap != null) {
+ if (!bkEnsemblePolicyToBkClientMap.isEmpty()) {
Review Comment:
Iterate over an empty map doesn't produce error. So from my style
preference, simply remove the if guard is better.
And the original code doesn't produce error also.
Closed as the same reason commented at
https://github.com/apache/pulsar/pull/18575#issuecomment-1324754681.
Please stop picking and random "fixing" such code snippet. See also
https://lkml.org/lkml/2021/6/18/153.
--
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]