fix NullPointerException hazard in StringUtils.join(..) method#3983
fix NullPointerException hazard in StringUtils.join(..) method#3983kezhenxu94 merged 1 commit intoapolloconfig:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3983 +/- ##
=========================================
Coverage 50.76% 50.76%
+ Complexity 2468 2462 -6
=========================================
Files 475 475
Lines 14600 14580 -20
Branches 1521 1514 -7
=========================================
- Hits 7412 7402 -10
+ Misses 6661 6651 -10
Partials 527 527
Continue to review full report at Codecov.
|
| @@ -355,11 +355,11 @@ public String format(T obj) { | |||
|
|
|||
| public static <T> String join(Collection<T> collection, String separator, | |||
There was a problem hiding this comment.
Seems this method is only used in tests, let's just remove it
There was a problem hiding this comment.
Removed method and changed the commit message to 'delete unused method StringUtils.join(..)'
Signed-off-by: WillardHu <wei.hu@daocloud.io>
58771ba to
9e30ebe
Compare
kezhenxu94
left a comment
There was a problem hiding this comment.
LGTM, although this is kind of breaking changes in apollo-client, I think these 2 methods are not meant to be used by users, and it's easy to migrate to other string util, I'm OK to remove them, WDYT @nobodyiam
|
@kezhenxu94 I agree with you that it's ok to remove these 2 methods |
Signed-off-by: WillardHu wei.hu@daocloud.io
What's the purpose of this PR
When the
collectionis null, aNullPointerExceptionis thrown here. Otherwiseiterator == nullis always false.Which issue(s) this PR fixes:
Fixes #
Brief changelog
fix NullPointerException hazard in StringUtils.join(..) method.
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean testto make sure this pull request doesn't break anything.CHANGESlog.