Bug 58342 - org.apache.tomcat.websocket.WsSession has repeated conditional tests
org.apache.tomcat.websocket.WsSession has repeated conditional tests
Status: RESOLVED FIXED
Product: Tomcat 9
Classification: Unclassified
Component: WebSocket
unspecified
PC All
: P2 minor (vote)
: -----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
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).