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

remove redundant volatile on initialized #9926

Merged
merged 1 commit into from
May 9, 2022

Conversation

sunshujie1990
Copy link

@sunshujie1990 sunshujie1990 commented Apr 15, 2022

What is the purpose of the change

init(org.apache.dubbo.config.ReferenceConfig#init) is a synchronized method, and field initialized only access in init, so volatile on initialized is redundant.

Brief changelog

remove redundant volatile flag on initialized

Checklist

  • 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.
  • 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.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • 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.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

init(org.apache.dubbo.config.ReferenceConfig#init) is a synchronized method, and field initialized only access in init, so volatile on initialized is redundant.
@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2022

Codecov Report

Merging #9926 (0c9bab5) into master (3a8e5e6) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #9926      +/-   ##
============================================
- Coverage     60.92%   60.88%   -0.04%     
+ Complexity      449      448       -1     
============================================
  Files          1100     1100              
  Lines         44557    44557              
  Branches       6486     6486              
============================================
- Hits          27145    27128      -17     
- Misses        14446    14464      +18     
+ Partials       2966     2965       -1     
Impacted Files Coverage Δ
.../java/org/apache/dubbo/config/ReferenceConfig.java 70.44% <ø> (ø)
...ntext/event/AwaitingNonWebApplicationListener.java 48.48% <0.00%> (-24.25%) ⬇️
.../apache/dubbo/remoting/transport/AbstractPeer.java 58.69% <0.00%> (-8.70%) ⬇️
...ng/transport/dispatcher/all/AllChannelHandler.java 82.75% <0.00%> (-6.90%) ⬇️
...ng/exchange/support/header/HeartbeatTimerTask.java 68.42% <0.00%> (-5.27%) ⬇️
...he/dubbo/remoting/transport/netty/NettyServer.java 70.17% <0.00%> (-3.51%) ⬇️
...apache/dubbo/common/config/ConfigurationUtils.java 67.74% <0.00%> (-3.23%) ⬇️
...rg/apache/dubbo/common/timer/HashedWheelTimer.java 79.72% <0.00%> (+0.34%) ⬆️
...g/apache/dubbo/registry/consul/ConsulRegistry.java 60.58% <0.00%> (+0.58%) ⬆️
...ache/dubbo/config/utils/ConfigValidationUtils.java 74.00% <0.00%> (+0.66%) ⬆️
... and 3 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 3a8e5e6...0c9bab5. Read the comment docs.

@chickenlj chickenlj added this to the 2.7.16 milestone May 9, 2022
@chickenlj chickenlj merged commit c25284e into apache:master May 9, 2022
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