You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "GungnirLaevatain (GitHub)" <gi...@apache.org> on 2019/12/30 02:58:33 UTC

[GitHub] [dubbo] GungnirLaevatain opened pull request #5555: Refactor PojoUtils#createMap

## What is the purpose of the change

I think that invoke `newInstance` to create a new object is equivalent to the operation that first determine types and then create a new object

## Brief changelog

`org.apache.dubbo.common.utils.PojoUtils#createMap`

## Verifying this change

pass the `PojoUtilsTest`

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

- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/dubbo/issues) 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](https://github.com/apache/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](https://github.com/apache/dubbo/wiki/Software-donation-guide).


[ Full content available at: https://github.com/apache/dubbo/pull/5555 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] GungnirLaevatain closed pull request #5555: Refactor PojoUtils#createMap

Posted by "GungnirLaevatain (GitHub)" <gi...@apache.org>.
[ pull request closed by GungnirLaevatain ]

[ Full content available at: https://github.com/apache/dubbo/pull/5555 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] codecov-io commented on issue #5555: Refactor PojoUtils#createMap

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=h1) Report
> Merging [#5555](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=desc) into [master](https://codecov.io/gh/apache/dubbo/commit/eeca7c947dff6392fa8057836333d3ba719747e9?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `33.33%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/5555/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=tree)

```diff
@@             Coverage Diff              @@
##             master    #5555      +/-   ##
============================================
- Coverage     61.24%   61.23%   -0.01%     
  Complexity      422      422              
============================================
  Files           922      922              
  Lines         37511    37493      -18     
  Branches       5433     5424       -9     
============================================
- Hits          22972    22960      -12     
+ Misses        12059    12048      -11     
- Partials       2480     2485       +5
```


| [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [.../java/org/apache/dubbo/common/utils/PojoUtils.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdXRpbHMvUG9qb1V0aWxzLmphdmE=) | `75.07% <33.33%> (+3.56%)` | `0 <0> (ø)` | :arrow_down: |
| [...dubbo/remoting/exchange/support/DefaultFuture.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L0RlZmF1bHRGdXR1cmUuamF2YQ==) | `79.27% <0%> (-9.91%)` | `0% <0%> (ø)` | |
| [.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC9Bc3luY1RvU3luY0ludm9rZXIuamF2YQ==) | `79.16% <0%> (-8.34%)` | `0% <0%> (ø)` | |
| [.../remoting/transport/netty4/NettyClientHandler.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5Q2xpZW50SGFuZGxlci5qYXZh) | `59.32% <0%> (-6.78%)` | `0% <0%> (ø)` | |
| [...pache/dubbo/remoting/transport/AbstractServer.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RTZXJ2ZXIuamF2YQ==) | `53.75% <0%> (-3.75%)` | `0% <0%> (ø)` | |
| [...e/dubbo/remoting/transport/netty/NettyChannel.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eUNoYW5uZWwuamF2YQ==) | `52.27% <0%> (-3.41%)` | `19% <0%> (-1%)` | |
| [.../dubbo/remoting/transport/netty4/NettyChannel.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5Q2hhbm5lbC5qYXZh) | `66.33% <0%> (-1.99%)` | `0% <0%> (ø)` | |
| [...g/apache/dubbo/registry/consul/ConsulRegistry.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktY29uc3VsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jb25zdWwvQ29uc3VsUmVnaXN0cnkuamF2YQ==) | `61.87% <0%> (-0.63%)` | `29% <0%> (ø)` | |
| [...rg/apache/dubbo/common/timer/HashedWheelTimer.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdGltZXIvSGFzaGVkV2hlZWxUaW1lci5qYXZh) | `63.1% <0%> (-0.35%)` | `0% <0%> (ø)` | |
| [.../apache/dubbo/config/bootstrap/DubboBootstrap.java](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9ib290c3RyYXAvRHViYm9Cb290c3RyYXAuamF2YQ==) | `53.71% <0%> (+0.41%)` | `0% <0%> (ø)` | :arrow_down: |
| ... and [5 more](https://codecov.io/gh/apache/dubbo/pull/5555/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=footer). Last update [eeca7c9...4a5c0f2](https://codecov.io/gh/apache/dubbo/pull/5555?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/dubbo/pull/5555 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] GungnirLaevatain commented on issue #5555: Refactor PojoUtils#createMap

Posted by "GungnirLaevatain (GitHub)" <gi...@apache.org>.
> Determining types and then create a new object is faster than newInstance.
> so I suggest keep original code

I agree with you based on this consideration. 

[ Full content available at: https://github.com/apache/dubbo/pull/5555 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org