Bug 58342 - org.apache.tomcat.websocket.WsSession has repeated conditional tests
Summary: org.apache.tomcat.websocket.WsSession has repeated conditional tests
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-07 17:58 UTC by DJ
Modified: 2015-09-10 13:38 UTC (History)
0 users



Attachments
Patch file (1.12 KB, patch)
2015-09-07 17:58 UTC, DJ
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DJ 2015-09-07 17:58:56 UTC
Created attachment 33078 [details]
Patch file

In the method WsSession.removeMessageHandler(), two `if` statements have repeated conditional tests. I did not investigate whether older versions of Tomcat have it however they're present in trunk. I am attaching a patch to fix it. I ran the tests and they passed with my changes.
Comment 1 Mark Thomas 2015-09-10 13:38:41 UTC
Many thanks for the report and the patch.

Your patch has been applied to trunk, 8.0.x (for 8.0.27 onwards) and 7.0.x (for 7.0.65 onwards).