Skip to content
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

Merged
merged 2 commits into from
Sep 22, 2019

Conversation

xiaoheng1
Copy link
Contributor

CollectionUtils类toStringMap方法没有检查 pairs 参数是否为空 in #5100.

添加如下代码

if (pairs == null || pairs.length == 0) {
return parameters;
}

resolve #5100

Copy link
Member

@CrazyHZM CrazyHZM left a 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) {
Copy link
Member

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.

Copy link
Contributor Author

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-io
Copy link

Codecov Report

Merging #5102 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...org/apache/dubbo/common/utils/CollectionUtils.java 88.78% <100%> (-0.74%) 0 <0> (ø)
.../apache/dubbo/qos/protocol/QosProtocolWrapper.java 65.85% <0%> (-17.08%) 0% <0%> (ø)
.../apache/dubbo/remoting/transport/AbstractPeer.java 58.69% <0%> (-10.87%) 0% <0%> (ø)
.../rpc/protocol/dubbo/LazyConnectExchangeClient.java 56.47% <0%> (-2.36%) 0% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 64.77% <0%> (-2.28%) 0% <0%> (ø)
...he/dubbo/registry/multicast/MulticastRegistry.java 67.87% <0%> (-1.81%) 0% <0%> (ø)
...dubbo/metadata/support/AbstractMetadataReport.java 72.83% <0%> (-1.74%) 0% <0%> (ø)
...pache/dubbo/remoting/transport/AbstractServer.java 47.91% <0%> (-1.05%) 0% <0%> (ø)
...a/org/apache/dubbo/monitor/dubbo/DubboMonitor.java 90.65% <0%> (+0.93%) 17% <0%> (+1%) ⬆️
...he/dubbo/remoting/transport/netty/NettyServer.java 73.21% <0%> (+3.57%) 9% <0%> (+1%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79c6166...cdaf4dd. Read the comment docs.

Copy link
Member

@CrazyHZM CrazyHZM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CrazyHZM CrazyHZM merged commit 0d09ef9 into apache:master Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CollectionUtils类toStringMap方法没有检查 pairs 参数是否为空
3 participants