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 2018/09/02 06:02:35 UTC

[GitHub] biyuhao opened a new issue #2424: Switch-case fall through in ChannelEventRunnable

biyuhao opened a new issue #2424: Switch-case fall through in ChannelEventRunnable
URL: https://github.com/apache/incubator-dubbo/issues/2424
 
 
   - [x] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
   - [x] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: latest master branch
   * Operating System version: macos
   * Java version: 1.8
   
   ### Description
   in ChannelEventRunnable#run there is a switch-case fall through which is introduced in https://github.com/apache/incubator-dubbo/pull/1643/commits/b3e91fae80fa6016f0c48884ca0db0f942f2af77 .
   I believe this is a little mistake, and UT is not necessary.
   
   As shown below, there is no `break` statement after `SENT`, I will send a pr later.
   ```
   ...
               case DISCONNECTED:
                   try {
                       handler.disconnected(channel);
                   } catch (Exception e) {
                       logger.warn("ChannelEventRunnable handle " + state + " operation error, channel is " + channel, e);
                   }
                   break;
               case SENT:
                   try {
                       handler.sent(channel, message);
                   } catch (Exception e) {
                       logger.warn("ChannelEventRunnable handle " + state + " operation error, channel is " + channel
                               + ", message is " + message, e);
                   }
                  // no break statement here!
               case CAUGHT:
                   try {
                       handler.caught(channel, exception);
                   } catch (Exception e) {
                       logger.warn("ChannelEventRunnable handle " + state + " operation error, channel is " + channel
                               + ", message is: " + message + ", exception is " + exception, e);
                   }
                   break;
               default:
                   logger.warn("unknown state: " + state + ", message is " + message);
               }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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