GH-3349: Use List.isEmpty() in the KafkaListenerEndpointRegistry

Fixes: #3349

* The `KafkaListenerEndpointRegistry` refactoring for `List.isEmpty()` instead of `List.size() > 0`
This commit is contained in:
wzq1022
2024-07-11 21:44:25 +08:00
committed by GitHub
parent bc3017c360
commit 3c2bd93326

View File

@@ -396,7 +396,7 @@ public class KafkaListenerEndpointRegistry implements ListenerContainerRegistry,
public void stop(Runnable callback) {
this.running = false;
Collection<MessageListenerContainer> listenerContainersToStop = getListenerContainers();
if (listenerContainersToStop.size() > 0) {
if (!listenerContainersToStop.isEmpty()) {
AggregatingCallback aggregatingCallback = new AggregatingCallback(listenerContainersToStop.size(),
callback);
for (MessageListenerContainer listenerContainer : listenerContainersToStop) {