Skip to content

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

@mp911de

Description

@mp911de

Affects: 5.3.10

After #26316, StringUtils.collectionToDelimitedString(…) behaves slightly different than the previous implementation in 5.3.9.

Calling StringUtils.collectionToDelimitedString(Collections.singleton(null), ",") in version 5.3.10 fails with:

java.lang.NullPointerException
	at org.springframework.util.StringUtils.collectionToDelimitedString(StringUtils.java:1304)
	at org.springframework.util.StringUtils.collectionToDelimitedString(StringUtils.java:1326)

whereas version 5.3.9 returned the string "null".

This ticket is to clarify which behavior is the correct one.

See also spring-projects/spring-data-redis#2167

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions