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

[GitHub] [incubator-dubbo] wanghbxxxx opened pull request #3398: move construction of ConfigChangeEvent outside the lambda expression

## What is the purpose of the change

move construction of ConfigChangeEvent outside the lambda expression,
the same way as ZooKeeper configcenter do in CacheListener.java 

## Brief changelog

XXXXX

## Verifying this change

XXXXX

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

- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/incubator-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 integration-test in [test module](https://github.com/apache/incubator-dubbo/tree/master/dubbo-test).
- [ ] 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/incubator-dubbo/wiki/Software-donation-guide).


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

[GitHub] [incubator-dubbo] satansk commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "satansk (GitHub)" <gi...@apache.org>.
> Another thing, can we make the field of `ConfigChangeEvent` `final`?
> It seems that if we want to share the `ConfigChangeEvent` instance, it is a better choice to make the `ConfigChangeEvent` field `final`.

Agree, it's better to be final.

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


[GitHub] [incubator-dubbo] codecov-io commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/3398?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@19c1af8`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `0%`.

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

```diff
@@            Coverage Diff            @@
##             master    #3398   +/-   ##
=========================================
  Coverage          ?   63.91%           
  Complexity        ?       71           
=========================================
  Files             ?      661           
  Lines             ?    28600           
  Branches          ?     4821           
=========================================
  Hits              ?    18280           
  Misses            ?     8101           
  Partials          ?     2219
```


| [Impacted Files](https://codecov.io/gh/apache/incubator-dubbo/pull/3398?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ter/support/apollo/ApolloDynamicConfiguration.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3398/diff?src=pr&el=tree#diff-ZHViYm8tY29uZmlnY2VudGVyL2R1YmJvLWNvbmZpZ2NlbnRlci1hcG9sbG8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZ2NlbnRlci9zdXBwb3J0L2Fwb2xsby9BcG9sbG9EeW5hbWljQ29uZmlndXJhdGlvbi5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/3398?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/incubator-dubbo/pull/3398?src=pr&el=footer). Last update [19c1af8...237a164](https://codecov.io/gh/apache/incubator-dubbo/pull/3398?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


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

[GitHub] [incubator-dubbo] carryxyh commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
LGTM
Thx for your contribution.

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


[GitHub] [incubator-dubbo] beiwei30 closed pull request #3398: move construction of ConfigChangeEvent outside the lambda expression

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

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


[GitHub] [incubator-dubbo] wanghbxxxx commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "wanghbxxxx (GitHub)" <gi...@apache.org>.
or make the ConfigChangeEvent instance immutable?

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
> or make the ConfigChangeEvent instance immutable?

This is not safe. If a listener modifies a property of `ConfigChangeEvent`, since the `ConfigChangeEvent` is shared, then the other listeners may not get the original data. This can lead to some unsafe factors.

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Another thing, can we make the field of `ConfigChangeEvent` `final`?
It seems that if we want to share the `ConfigChangeEvent` instance, it is a better choice to make the `ConfigChangeEvent` field `final`.

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Tips: Objects used in inner classes are generally marked as `final`. 
This matter has nothing to do with logic right or wrong, but it is related to code specifications.

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


[GitHub] [incubator-dubbo] wanghbxxxx commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "wanghbxxxx (GitHub)" <gi...@apache.org>.



> > or make the ConfigChangeEvent instance immutable?
> 
> This is not safe. If a listener modifies a property of `ConfigChangeEvent`, since the `ConfigChangeEvent` is shared, then the other listeners may not get the original data. This can lead to some unsafe factors.

sorry, i mean make ConfigChangeEvent unchangable, so no listener can modify it.
I'm trying to extract an Interface with the same name which have getters only.
and with a default implementation

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3398: move construction of ConfigChangeEvent outside the lambda expression

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Pls commit your changes, I will have a look.
:)

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