Skip to content

fix #7315 redundant box for boolean and refactor method filterInvoker#7316

Merged
AlbumenJ merged 1 commit intoapache:masterfrom
24kpure:master
Mar 11, 2021
Merged

fix #7315 redundant box for boolean and refactor method filterInvoker#7316
AlbumenJ merged 1 commit intoapache:masterfrom
24kpure:master

Conversation

@24kpure
Copy link
Copy Markdown
Contributor

@24kpure 24kpure commented Mar 3, 2021

#7315

What is the purpose of the change

unboxing boolean and refactor method filterInvoker

Brief changelog

1.org.apache.dubbo.rpc.cluster.router.tag.TagRouter#isForceUseTag
Boolean.valueOf -> Boolean.parseBoolean
2.org.apache.dubbo.rpc.cluster.router.tag.TagRouter#filterInvoker
refactor in stream
3.org.apache.dubbo.rpc.cluster.router.tag.TagRouter#filterUsingStaticTag
remove param(result) initial value

Verifying this change

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-io commented Mar 3, 2021

Codecov Report

Merging #7316 (9eca39b) into master (fcc6298) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7316      +/-   ##
============================================
- Coverage     59.06%   59.02%   -0.04%     
+ Complexity      462      460       -2     
============================================
  Files          1044     1044              
  Lines         42473    42466       -7     
  Branches       6228     6224       -4     
============================================
- Hits          25085    25064      -21     
- Misses        14588    14599      +11     
- Partials       2800     2803       +3     
Impacted Files Coverage Δ Complexity Δ
...apache/dubbo/rpc/cluster/router/tag/TagRouter.java 32.25% <0.00%> (-1.75%) 0.00 <0.00> (ø)
.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java 62.06% <0.00%> (-10.35%) 0.00% <0.00%> (ø%)
...e/dubbo/remoting/transport/netty/NettyChannel.java 52.27% <0.00%> (-7.96%) 19.00% <0.00%> (-2.00%)
...dubbo/remoting/exchange/support/DefaultFuture.java 82.90% <0.00%> (-5.13%) 0.00% <0.00%> (ø%)
...he/dubbo/common/threadpool/ThreadlessExecutor.java 94.23% <0.00%> (-1.93%) 0.00% <0.00%> (ø%)
...a/org/apache/dubbo/monitor/dubbo/DubboMonitor.java 86.66% <0.00%> (-1.91%) 16.00% <0.00%> (ø%)
...pache/dubbo/registry/support/AbstractRegistry.java 79.62% <0.00%> (-1.49%) 0.00% <0.00%> (ø%)
...rg/apache/dubbo/common/timer/HashedWheelTimer.java 79.38% <0.00%> (-0.35%) 0.00% <0.00%> (ø%)
...apache/dubbo/common/extension/ExtensionLoader.java 78.29% <0.00%> (+0.22%) 0.00% <0.00%> (ø%)
...he/dubbo/registry/multicast/MulticastRegistry.java 68.05% <0.00%> (+0.92%) 0.00% <0.00%> (ø%)
... 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 fcc6298...9eca39b. Read the comment docs.

*/
private <T> List<Invoker<T>> filterUsingStaticTag(List<Invoker<T>> invokers, URL url, Invocation invocation) {
List<Invoker<T>> result = invokers;
List<Invoker<T>> result;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why remove this assignment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I see, I reviewed the wrong method.

*/
private <T> List<Invoker<T>> filterUsingStaticTag(List<Invoker<T>> invokers, URL url, Invocation invocation) {
List<Invoker<T>> result = invokers;
List<Invoker<T>> result;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I see, I reviewed the wrong method.

@chickenlj
Copy link
Copy Markdown
Contributor

LGTM.

Copy link
Copy Markdown
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

LGTM.

@AlbumenJ AlbumenJ merged commit 44e754b into apache:master Mar 11, 2021
AlbumenJ added a commit to AlbumenJ/dubbo that referenced this pull request May 27, 2021
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.

4 participants