Gunnar Hillert opened SPR-8760 and commented
Currently there is an Assert.noNullElements method, but it currently accepts only an array, not a Collection. In order to provide better null checking it would be nice to have applicable methods that also accept Collections and Maps as parameters.
Also, for arrays the following Note applies: "Does not complain if the array is empty!". However, it would be nice if for maps and collections we have a method that checks for all null/empty conditions and ensures that the passed in Map/Collection is:
- Not Null
- Not Empty
- Does not contain Null elements
Affects: 3.1 RC1
1 votes, 2 watchers
Comment From: smartinsempere
Assert.noNullElements method without an exception message parameter has been annotated as deprecated.
Should we consider to implement Assert.noNullElements for Collections without this exception message?
Comment From: jhoeller
Since #23151, Assert.noNullElements
has Collection
variants. We have no plans to extend that arrangement since Assert
is arguably large enough already, and we primarily use it for internal purposes where it currently covers all of our needs.