You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/04/07 12:50:25 UTC

[GitHub] [rocketmq] dugenkui03 opened a new issue, #4130: Remove the exception which will never thrown by method from method sigture

dugenkui03 opened a new issue, #4130:
URL: https://github.com/apache/rocketmq/issues/4130

   #### **BUG REPORT**
   In `DefaultMQAdminExtImpl` and `MQClientAPIImpl`, there are many checked Exceptions which will never throw by method but used on method signture. 
   
   #### **问题描述**
   在`DefaultMQAdminExtImpl` 和 `MQClientAPIImpl`中的很多方法上定义了一些永远不会抛出的**检查异常**,这种不恰当的定义带来的问题是:上层方法需要对不会抛出的异常做处理;也许这些异常之前会抛出、现在方法体被修改后不会在抛出了,此时我认为我们应该去掉这些异常、让上层方法通过方法签名即使感知到接口语义的变化。
   
   例如,如下红框中的 catch 永远不会被调用到:
   <img width="1674" alt="image" src="https://user-images.githubusercontent.com/18216266/162202489-02985f12-a0e1-4f78-9fca-3165864b008a.png">
   


-- 
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: dev-unsubscribe@rocketmq.apache.org.apache.org

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


[GitHub] [rocketmq] dugenkui03 closed issue #4130: Remove the exception which will never thrown by method from method sigture

Posted by GitBox <gi...@apache.org>.
dugenkui03 closed issue #4130: Remove the exception which will never thrown by method from method sigture
URL: https://github.com/apache/rocketmq/issues/4130


-- 
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: dev-unsubscribe@rocketmq.apache.org

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