You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/10/22 03:16:23 UTC

[GitHub] [dubbo] zhangzq7 opened a new pull request, #10781: remove useless code, the instanceof test always return true

zhangzq7 opened a new pull request, #10781:
URL: https://github.com/apache/dubbo/pull/10781

   remove useless code, the instanceof test will always return true


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhangzq7 commented on a diff in pull request #10781: remove useless code, the instanceof test always return true

Posted by GitBox <gi...@apache.org>.
zhangzq7 commented on code in PR #10781:
URL: https://github.com/apache/dubbo/pull/10781#discussion_r1002431853


##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java:
##########
@@ -194,9 +194,11 @@ public static Object getMockObject(ExtensionDirector extensionDirector, String m
                 + ", please check if there's mock class or instance implementing interface "
                 + serviceType.getName(), e);
         }
-        if (mockClass == null || !serviceType.isAssignableFrom(mockClass)) {
-            throw new IllegalStateException("The mock class " + mockClass.getName() +
-                " not implement interface " + serviceType.getName());
+        if (mockClass == null) {
+            throw new IllegalStateException("not implement interface " + serviceType.getName());

Review Comment:
   mockService perhaps null



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhangzq7 closed pull request #10781: remove useless code, the instanceof test always return true

Posted by GitBox <gi...@apache.org>.
zhangzq7 closed pull request #10781: remove useless code, the instanceof test always return true
URL: https://github.com/apache/dubbo/pull/10781


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter commented on pull request #10781: remove useless code, the instanceof test always return true

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10781:
URL: https://github.com/apache/dubbo/pull/10781#issuecomment-1287686795

   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/10781?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#10781](https://codecov.io/gh/apache/dubbo/pull/10781?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (97cdf90) into [3.1](https://codecov.io/gh/apache/dubbo/commit/f37502c0058e62bc994805088ee4564b56ce1d03?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f37502c) will **decrease** coverage by `0.54%`.
   > The diff coverage is `25.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.1   #10781      +/-   ##
   ============================================
   - Coverage     65.13%   64.58%   -0.55%     
   + Complexity      468      467       -1     
   ============================================
     Files          1336     1336              
     Lines         56963    56959       -4     
     Branches       8425     8401      -24     
   ============================================
   - Hits          37100    36785     -315     
   - Misses        15882    16208     +326     
   + Partials       3981     3966      -15     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/10781?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubbo/config/deploy/DefaultApplicationDeployer.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9kZXBsb3kvRGVmYXVsdEFwcGxpY2F0aW9uRGVwbG95ZXIuamF2YQ==) | `72.18% <0.00%> (-0.29%)` | :arrow_down: |
   | [...center/initializer/ConfigZookeeperInitializer.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tdGVzdC9kdWJiby10ZXN0LWNoZWNrL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby90ZXN0L2NoZWNrL3JlZ2lzdHJ5Y2VudGVyL2luaXRpYWxpemVyL0NvbmZpZ1pvb2tlZXBlckluaXRpYWxpemVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/support/MockInvoker.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9zdXBwb3J0L01vY2tJbnZva2VyLmphdmE=) | `83.05% <50.00%> (-0.71%)` | :arrow_down: |
   | [...luster/router/script/ScriptStateRouterFactory.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY2x1c3Rlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL2NsdXN0ZXIvcm91dGVyL3NjcmlwdC9TY3JpcHRTdGF0ZVJvdXRlckZhY3RvcnkuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...zookeeper/curator/CuratorZookeeperTransporter.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvci9DdXJhdG9yWm9va2VlcGVyVHJhbnNwb3J0ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...pc/cluster/router/file/FileStateRouterFactory.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY2x1c3Rlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL2NsdXN0ZXIvcm91dGVyL2ZpbGUvRmlsZVN0YXRlUm91dGVyRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (-80.96%)` | :arrow_down: |
   | [...o/rpc/cluster/router/script/ScriptStateRouter.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY2x1c3Rlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL2NsdXN0ZXIvcm91dGVyL3NjcmlwdC9TY3JpcHRTdGF0ZVJvdXRlci5qYXZh) | `0.00% <0.00%> (-67.31%)` | :arrow_down: |
   | [...mmon/serialize/fastjson2/FastJson2ObjectInput.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc2VyaWFsaXphdGlvbi9kdWJiby1zZXJpYWxpemF0aW9uLWZhc3Rqc29uMi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vY29tbW9uL3NlcmlhbGl6ZS9mYXN0anNvbjIvRmFzdEpzb24yT2JqZWN0SW5wdXQuamF2YQ==) | `0.00% <0.00%> (-62.50%)` | :arrow_down: |
   | [...ting/zookeeper/curator/CuratorZookeeperClient.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvci9DdXJhdG9yWm9va2VlcGVyQ2xpZW50LmphdmE=) | `14.10% <0.00%> (-56.42%)` | :arrow_down: |
   | [...mon/serialize/fastjson2/FastJson2ObjectOutput.java](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc2VyaWFsaXphdGlvbi9kdWJiby1zZXJpYWxpemF0aW9uLWZhc3Rqc29uMi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vY29tbW9uL3NlcmlhbGl6ZS9mYXN0anNvbjIvRmFzdEpzb24yT2JqZWN0T3V0cHV0LmphdmE=) | `0.00% <0.00%> (-56.25%)` | :arrow_down: |
   | ... and [52 more](https://codecov.io/gh/apache/dubbo/pull/10781/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10781: remove useless code, the instanceof test always return true

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10781:
URL: https://github.com/apache/dubbo/pull/10781#discussion_r1002848651


##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java:
##########
@@ -194,9 +194,11 @@ public static Object getMockObject(ExtensionDirector extensionDirector, String m
                 + ", please check if there's mock class or instance implementing interface "
                 + serviceType.getName(), e);
         }
-        if (mockClass == null || !serviceType.isAssignableFrom(mockClass)) {
-            throw new IllegalStateException("The mock class " + mockClass.getName() +
-                " not implement interface " + serviceType.getName());
+        if (mockClass == null) {
+            throw new IllegalStateException("not implement interface " + serviceType.getName());

Review Comment:
   How about log out if is not null?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10781: remove useless code, the instanceof test always return true

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10781:
URL: https://github.com/apache/dubbo/pull/10781#discussion_r1002404921


##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java:
##########
@@ -194,9 +194,11 @@ public static Object getMockObject(ExtensionDirector extensionDirector, String m
                 + ", please check if there's mock class or instance implementing interface "
                 + serviceType.getName(), e);
         }
-        if (mockClass == null || !serviceType.isAssignableFrom(mockClass)) {
-            throw new IllegalStateException("The mock class " + mockClass.getName() +
-                " not implement interface " + serviceType.getName());
+        if (mockClass == null) {
+            throw new IllegalStateException("not implement interface " + serviceType.getName());

Review Comment:
   log out `mockService` to help users find out why



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org