Expected Behavior
In ProviderManager.checkState(), this.providers should be checked for null elements using modern Spring Framework utilities that offer clear intent and good readability without unnecessary iterator creation.
Current Behavior
Currently, the null check uses Assert.isTrue with a negated CollectionUtils.contains condition:
Assert.isTrue(!CollectionUtils.contains(this.providers.iterator(), null),
"providers list cannot contain null values");
Context
Since Spring Framework 5.2, Assert.noNullElements(Collection, String) directly supports collections.
Refactoring this line to:
Assert.noNullElements(this.providers,
"providers list cannot contain null values");
Expected Behavior
In
ProviderManager.checkState(),this.providersshould be checked for null elements using modern Spring Framework utilities that offer clear intent and good readability without unnecessary iterator creation.Current Behavior
Currently, the null check uses
Assert.isTruewith a negatedCollectionUtils.containscondition:Context
Since Spring Framework 5.2,
Assert.noNullElements(Collection, String)directly supports collections.Refactoring this line to: