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

replace hard coded values with constants and small refactor #3101

Merged
merged 2 commits into from
Dec 30, 2018

Conversation

khanimteyaz
Copy link
Contributor

@khanimteyaz khanimteyaz commented Dec 29, 2018

What is the purpose of the change

Replace existing hard coded values for dubbo-config below classes

dubbo-common/src/main/java/org/apache/dubbo/common/Constants.java
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractConfig.java
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractReferenceConfig.java
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConsumerConfig.java
Along with hard coded value replacement have done small refactoring to use java stream and lambda.

Brief changelog

Hard coded value replacement of few dubbo-config java classes and small refactoring.

Verifying this change

I have run all the existing UT and it passed.

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

  • Make sure there is a 3100 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 integration-test in test module.
  • 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

Codecov Report

Merging #3101 into master will decrease coverage by 0.02%.
The diff coverage is 85.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3101      +/-   ##
============================================
- Coverage      63.6%   63.57%   -0.03%     
  Complexity       75       75              
============================================
  Files           653      653              
  Lines         28218    28214       -4     
  Branches       4803     4800       -3     
============================================
- Hits          17947    17936      -11     
- Misses         8002     8012      +10     
+ Partials       2269     2266       -3
Impacted Files Coverage Δ Complexity Δ
...c/main/java/org/apache/dubbo/common/Constants.java 92.85% <ø> (ø) 0 <0> (ø) ⬇️
...n/java/org/apache/dubbo/config/ConsumerConfig.java 92.3% <0%> (ø) 0 <0> (ø) ⬇️
...g/apache/dubbo/config/AbstractReferenceConfig.java 93.75% <100%> (ø) 0 <0> (ø) ⬇️
...n/java/org/apache/dubbo/config/AbstractConfig.java 79.09% <100%> (+0.64%) 0 <0> (ø) ⬇️
.../org/apache/dubbo/config/AbstractMethodConfig.java 94% <75%> (ø) 0 <0> (ø) ⬇️
...g/apache/dubbo/config/AbstractInterfaceConfig.java 75.08% <87.5%> (+0.33%) 0 <0> (ø) ⬇️
...onfig/spring/extension/SpringExtensionFactory.java 80.48% <0%> (-4.88%) 0% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 61.17% <0%> (-4.71%) 0% <0%> (ø)
.../apache/dubbo/remoting/transport/AbstractPeer.java 60.86% <0%> (-4.35%) 0% <0%> (ø)
...c/main/java/org/apache/dubbo/rpc/RpcException.java 82.75% <0%> (-3.45%) 0% <0%> (ø)
... and 8 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 f99f015...284d282. Read the comment docs.

Copy link
Member

@zonghaishang zonghaishang left a comment

Choose a reason for hiding this comment

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

It looks good

@zonghaishang zonghaishang merged commit 383a37e into apache:master Dec 30, 2018
@khanimteyaz khanimteyaz deleted the dubbo-config-constants-change branch December 30, 2018 13:09
@khanimteyaz
Copy link
Contributor Author

@zonghaishang thanks a lot. Appreciate your time and merging it to master.

khanimteyaz added a commit to khanimteyaz/incubator-dubbo that referenced this pull request Jan 18, 2019
)

* repalce hard coded values with constants and small refactor

* style issue fixed
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.

None yet

3 participants