Bug 58342

Summary: org.apache.tomcat.websocket.WsSession has repeated conditional tests
Product: Tomcat 9 Reporter: DJ <dinesh.a.joshi>
Component: WebSocketAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: unspecified   
Target Milestone: -----   
Hardware: PC   
OS: All   
Attachments: Patch file

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).