https://github.com/spring-projects/spring-framework/blob/7e2b81729eefe31e9e8b2872b0de0adc1bad2162/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java#L839

Comment From: jhoeller

Well spotted! Since we have such emptiness checks in other places already, in particular in hotspot code paths and for collections that tend to be empty at runtime, I've applied our common CollectionUtils.isEmpty check here as well now. While it won't make much difference performance-wise, it does avoid allocation of an Iterator which is generally worthwhile in such scenarios.