dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] biyuhao opened a new issue #2424: Switch-case fall through in ChannelEventRunnable
Date Sun, 02 Sep 2018 06:02:35 GMT
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


Mime
View raw message