Skip to content

[Dubbo-Optimization] polish NetUtils#matchIpRange#5773

Merged
chickenlj merged 1 commit intoapache:masterfrom
tangcent:opti/netutils
Apr 2, 2020
Merged

[Dubbo-Optimization] polish NetUtils#matchIpRange#5773
chickenlj merged 1 commit intoapache:masterfrom
tangcent:opti/netutils

Conversation

@tangcent
Copy link
Copy Markdown
Contributor

What is the purpose of the change

Optimize method NetUtils#matchIpRange
I have searched in opened PR.
Fell free to close it if it has be included in other PRs or It is not expected to change.

Brief changelog

  1. Rename variable ss to ignored because it is never be used.
  2. Simplified condition?:true:false -> condition
  3. Use StringUtils#split(String,char) instead of String#split(regex)
  4. Calculate ipAddress when it will be used immediately

Verifying this change

The current test case 'NetUtilsTest' is enough.

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #5773 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5773      +/-   ##
============================================
- Coverage     61.42%   61.38%   -0.04%     
+ Complexity      498      496       -2     
============================================
  Files           979      979              
  Lines         38828    38869      +41     
  Branches       5569     5600      +31     
============================================
+ Hits          23851    23861      +10     
- Misses        12360    12384      +24     
- Partials       2617     2624       +7
Impacted Files Coverage Δ Complexity Δ
...n/java/org/apache/dubbo/common/utils/NetUtils.java 67.45% <100%> (-0.13%) 0 <0> (ø)
...che/dubbo/remoting/transport/mina/MinaChannel.java 39.47% <0%> (-10.53%) 15% <0%> (-1%)
...port/identifier/BaseServiceMetadataIdentifier.java 67.85% <0%> (-4.88%) 0% <0%> (ø)
...dubbo/common/status/support/LoadStatusChecker.java 46.15% <0%> (-3.85%) 0% <0%> (ø)
...pache/dubbo/remoting/transport/AbstractServer.java 53.75% <0%> (-3.75%) 0% <0%> (ø)
...he/dubbo/remoting/transport/netty/NettyServer.java 70.17% <0%> (-3.51%) 8% <0%> (-1%)
.../remoting/transport/netty4/NettyServerHandler.java 56.81% <0%> (-2.28%) 0% <0%> (ø)
...ting/exchange/support/header/HeartbeatHandler.java 83.72% <0%> (-2%) 0% <0%> (ø)
.../remoting/transport/netty4/NettyClientHandler.java 57.62% <0%> (-1.7%) 0% <0%> (ø)
...dubbo/remoting/exchange/support/DefaultFuture.java 79.27% <0%> (-1.1%) 0% <0%> (ø)
... and 24 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 12d99d6...8d074c9. Read the comment docs.

@chickenlj chickenlj merged commit d6672af into apache:master Apr 2, 2020
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.

3 participants