You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "LiZhenNet (GitHub)" <gi...@apache.org> on 2018/11/19 08:33:07 UTC

[GitHub] [incubator-dubbo] LiZhenNet opened pull request #2803: Fix telnet can not find method with enum type

## What is the purpose of the change

Fix telnet can not find method with enum type

## Brief changelog
For example:
method:   Type getType(Type type);
When I invoke it in telnet , like 'invoke getType("High")', InvokeTelnetHandler#isMatch always return false;

## Verifying this change
Run the test:
org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokerTelnetHandlerTest#testInvokeByPassingEnumValue

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) filed 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` & `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/2803 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] codecov-io commented on issue #2803: Fix telnet can not find method with enum type

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2803?src=pr&el=h1) Report
> Merging [#2803](https://codecov.io/gh/apache/incubator-dubbo/pull/2803?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-dubbo/commit/9466425f51d182a003c609c4f12bf64ff8f95a1a?src=pr&el=desc) will **increase** coverage by `1.05%`.
> The diff coverage is `60%`.

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

```diff
@@            Coverage Diff             @@
##           master    #2803      +/-   ##
==========================================
+ Coverage   62.49%   63.55%   +1.05%     
==========================================
  Files         599      577      -22     
  Lines       27918    25934    -1984     
  Branches     4829     4542     -287     
==========================================
- Hits        17447    16482     -965     
+ Misses       8210     7294     -916     
+ Partials     2261     2158     -103
```


| [Impacted Files](https://codecov.io/gh/apache/incubator-dubbo/pull/2803?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL3Byb3RvY29sL2R1YmJvL3RlbG5ldC9JbnZva2VUZWxuZXRIYW5kbGVyLmphdmE=) | `57.95% <60%> (+0.12%)` | :arrow_up: |
| [.../remoting/transport/netty4/NettyClientHandler.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5Q2xpZW50SGFuZGxlci5qYXZh) | `75% <0%> (-13.89%)` | :arrow_down: |
| [...ache/dubbo/remoting/transport/AbstractChannel.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RDaGFubmVsLmphdmE=) | `75% <0%> (-12.5%)` | :arrow_down: |
| [.../apache/dubbo/remoting/transport/AbstractPeer.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RQZWVyLmphdmE=) | `63.04% <0%> (-8.7%)` | :arrow_down: |
| [...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL3Byb3RvY29sL2R1YmJvL0NoYW5uZWxXcmFwcGVkSW52b2tlci5qYXZh) | `41.66% <0%> (-8.34%)` | :arrow_down: |
| [...ng/exchange/support/header/HeartbeatTimerTask.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L2hlYWRlci9IZWFydGJlYXRUaW1lclRhc2suamF2YQ==) | `73.68% <0%> (-5.27%)` | :arrow_down: |
| [.../apache/dubbo/qos/protocol/QosProtocolWrapper.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcGx1Z2luL2R1YmJvLXFvcy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcW9zL3Byb3RvY29sL1Fvc1Byb3RvY29sV3JhcHBlci5qYXZh) | `64.1% <0%> (-5.13%)` | :arrow_down: |
| [...he/dubbo/remoting/transport/netty/NettyServer.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eVNlcnZlci5qYXZh) | `67.85% <0%> (-3.58%)` | :arrow_down: |
| [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `81.25% <0%> (-1.93%)` | :arrow_down: |
| [...bo/remoting/transport/netty/NettyCodecAdapter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eUNvZGVjQWRhcHRlci5qYXZh) | `53.12% <0%> (-1.57%)` | :arrow_down: |
| ... and [23 more](https://codecov.io/gh/apache/incubator-dubbo/pull/2803/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2803?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/2803?src=pr&el=footer). Last update [9466425...8ba6bcd](https://codecov.io/gh/apache/incubator-dubbo/pull/2803?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/2803 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2803: Fix telnet can not find method with enum type

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
maybe...
can someone help to review it?

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


[GitHub] [incubator-dubbo] LiZhenNet commented on issue #2803: Fix telnet can not find method with enum type

Posted by "LiZhenNet (GitHub)" <gi...@apache.org>.
@chickenlj  one more thing ,he document  about telnet  is wrong,

> invoke
> invoke XxxService.xxxMethod({"prop": "value"}): 调用服务的方法
> invoke xxxMethod({"prop": "value"}): 调用服务的方法(自动查找包含此方法的服务)

if you input the arg like json string ,   the arg list  length is always  1 , if the method with multiple parameters ,InvokeTelnetHandler#isMatch always return false。








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

[GitHub] [incubator-dubbo] beiwei30 closed pull request #2803: Fix telnet can not find method with enum type

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

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


[GitHub] [incubator-dubbo] LiZhenNet commented on issue #2803: Fix telnet can not find method with enum type

Posted by "LiZhenNet (GitHub)" <gi...@apache.org>.
Any update?  @chickenlj 

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


[GitHub] [incubator-dubbo] LiZhenNet commented on issue #2803: Fix telnet can not find method with enum type

Posted by "LiZhenNet (GitHub)" <gi...@apache.org>.
@chickenlj  one more thing ,the document about telnet is wrong,

> invoke
> invoke XxxService.xxxMethod({"prop": "value"}): 调用服务的方法
> invoke xxxMethod({"prop": "value"}): 调用服务的方法(自动查找包含此方法的服务)

if you input the arg like json string ,   the arg list  length is always  1 , if the method with multiple parameters ,InvokeTelnetHandler#isMatch always return false。








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

[GitHub] [incubator-dubbo] chickenlj commented on issue #2803: Fix telnet can not find method with enum type

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
I will take a look at this PR.

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


[GitHub] [incubator-dubbo] beiwei30 commented on pull request #2803: Fix telnet can not find method with enum type

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
I think it is not necessary to call `CompatibleTypeUtils.compatibleTypeConvert(arg, type`, this logic can be simplified as below, since we know arg is always a String type in this case.

```java
            if (ReflectUtils.isPrimitive(arg.getClass())) {
                if (!ReflectUtils.isPrimitive(type) && !type.isEnum()) {
                    return false;
                }
            }
```

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


[GitHub] [incubator-dubbo] beiwei30 commented on issue #2803: Fix telnet can not find method with enum type

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
I'm on it.

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


[GitHub] [incubator-dubbo] LiZhenNet commented on issue #2803: Fix telnet can not find method with enum type

Posted by "LiZhenNet (GitHub)" <gi...@apache.org>.
It's just small changes. @carryxyh 

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


[GitHub] [incubator-dubbo] LiZhenNet commented on issue #2803: Fix telnet can not find method with enum type

Posted by "LiZhenNet (GitHub)" <gi...@apache.org>.
It's just  a small pr. @carryxyh 

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


[GitHub] [incubator-dubbo] LiZhenNet commented on issue #2803: Fix telnet can not find method with enum type

Posted by "LiZhenNet (GitHub)" <gi...@apache.org>.
Do you mind merge this pr?
@carryxyh  @zonghaishang 

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