-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
修复 CollectionUtils类toStringMap方法没有检查 pairs 参数是否为空. #5102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at my comment.
@@ -173,6 +173,10 @@ private static boolean objectEquals(Object obj1, Object obj2) { | |||
|
|||
public static Map<String, String> toStringMap(String... pairs) { | |||
Map<String, String> parameters = new HashMap<>(); | |||
if (pairs == null || pairs.length == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace it with the ArrayUtils#isEmpty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,i will change it.
Codecov Report
@@ Coverage Diff @@
## master #5102 +/- ##
============================================
- Coverage 64.08% 64.03% -0.05%
- Complexity 452 455 +3
============================================
Files 769 769
Lines 33261 33263 +2
Branches 5249 5250 +1
============================================
- Hits 21314 21300 -14
- Misses 9516 9531 +15
- Partials 2431 2432 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CollectionUtils类toStringMap方法没有检查 pairs 参数是否为空 in #5100.
添加如下代码
if (pairs == null || pairs.length == 0) {
return parameters;
}
resolve #5100