Skip to content

Provide variations of Assert.noNullElements that accepts a Collection or Map [SPR-8760] #13403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Oct 12, 2011 · 2 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@smartinsempere
Copy link

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?

@jhoeller
Copy link
Contributor

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.

@jhoeller jhoeller added the status: declined A suggestion or change that we don't feel we should currently apply label Jul 13, 2023
@jhoeller jhoeller removed this from the General Backlog milestone Jul 13, 2023
@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants