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