-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support arrays, collections, & maps in ObjectUtils.nullSafeConciseToS…
…tring() Prior to this commit, there was no explicit support for arrays, collections, and maps in nullSafeConciseToString(). This lead to string representations such as the following, regardless of whether the array, collection, or map was empty. - char[]@1623b78d - java.util.ImmutableCollections$List12@74fe5c40 - java.util.ImmutableCollections$MapN@10e31a9a This commit introduces explicit support for arrays, collections, and maps in nullSafeConciseToString(), which results in the following empty/non-empty string representations. - array: {} / {...} - collection: [] / [...] - map: {} / {...} The reason a string representation of an array uses "{}" instead of "[]" (like in Arrays.toString(...)) is that ObjectUtils.nullSafeToString(<array>) already follows that convention, and the implementation of nullSafeConciseToString() aligns with that for the sake of consistency. Closes gh-30810
- Loading branch information
Showing
2 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters