Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch-case fall through in ChannelEventRunnable #2424

Closed
2 tasks done
biyuhao opened this issue Sep 2, 2018 · 0 comments · Fixed by #2426
Closed
2 tasks done

Switch-case fall through in ChannelEventRunnable #2424

biyuhao opened this issue Sep 2, 2018 · 0 comments · Fixed by #2426

Comments

@biyuhao
Copy link
Member

biyuhao commented Sep 2, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ 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 b3e91fa .
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);
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant