Skip to content
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

StringUtils.collectionToDelimitedString(…) fails with NullPointerException when the collection contains null #27419

Closed
wants to merge 1 commit into from

Conversation

Koooooo-7
Copy link
Contributor

Using String.valueOf toString this element, cover the null case.

fix #27411

@pivotal-cla
Copy link

@Koooooo-7 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 16, 2021
@pivotal-cla
Copy link

@Koooooo-7 Thank you for signing the Contributor License Agreement!

@bclozel bclozel self-assigned this Sep 16, 2021
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression labels Sep 16, 2021
@bclozel bclozel changed the title Fix StringUtils.collectionToDelimitedString when collection with null element. StringUtils.collectionToDelimitedString(…) fails with NullPointerException when the collection contains null Sep 17, 2021
@bclozel bclozel added this to the 5.3.11 milestone Sep 17, 2021
bclozel pushed a commit that referenced this pull request Sep 17, 2021
Prior to this commit, calling `StringUtils#collectionToDelimitedString`
would fail with an NPE if the collection contains null elements.

This commit ensures that null elements are converted as `"null"` in the
resulting String without failure.

See gh-27419
@bclozel bclozel closed this in a50537f Sep 17, 2021
@jhoeller jhoeller removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 17, 2021
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) type: regression A bug that is also a regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StringUtils.collectionToDelimitedString(…) fails with NullPointerException when the collection contains null
6 participants