fix: toCommaDelimitedString returns "null,null" when inputs are null#15338
fix: toCommaDelimitedString returns "null,null" when inputs are null#15338AlbumenJ merged 2 commits intoapache:3.3from
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15338 +/- ##
=============================================
- Coverage 60.76% 35.65% -25.12%
+ Complexity 10916 10901 -15
=============================================
Files 1886 1886
Lines 86127 86130 +3
Branches 12903 12904 +1
=============================================
- Hits 52335 30707 -21628
- Misses 28335 50972 +22637
+ Partials 5457 4451 -1006
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| */ | ||
| public static String toCommaDelimitedString(String one, String... others) { | ||
| if (one == null || others == null) { | ||
| return null; |
There was a problem hiding this comment.
if one != null && others == null
should return one?
There was a problem hiding this comment.
yes, it should return one
55ddfa4 to
df5f6d4
Compare
Issue
#15321
What is the purpose of the change?
This change corrects the behavior of StringUtils.toCommaDelimitedString(String one, String... others) to return null when either argument is null, as described in its Javadoc. Previously, the method would return a string like "null,null", which could lead to misleading outputs and test failures. This update ensures consistency between the method's implementation and its documented contract.
Checklist