You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/10/25 23:49:41 UTC

[Bug 58545] New: WsHandshakeRequest inefficient use of keySet

https://bz.apache.org/bugzilla/show_bug.cgi?id=58545

            Bug ID: 58545
           Summary: WsHandshakeRequest inefficient use of keySet
           Product: Tomcat 8
           Version: trunk
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: anthony@whitford.com

Created attachment 33217
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33217&action=edit
Replaces inefficient use of keySet() with more efficient entrySet()

In WsHandshakeRequest...

        for (String pathName : pathParams.keySet()) {
            newParameters.put(pathName,
                    Collections.unmodifiableList(
                            Arrays.asList(pathParams.get(pathName))));
        }


should be:

        for (Entry<String,String> entry : pathParams.entrySet()) {
            final String pathName = entry.getKey();
            newParameters.put(pathName,
                    Collections.unmodifiableList(
                            Arrays.asList(entry.getValue())));
        }

to avoid the extra lookup.

See http://findbugs.sourceforge.net/bugDescriptions.html#WMI_WRONG_MAP_ITERATOR

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 58545] WsHandshakeRequest inefficient use of keySet

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58545

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Violeta Georgieva <vi...@apache.org> ---
Hi,

Thanks for the report and the patch.
I applied the same fix on other places in the code also.
The fix is available in trunk, 8.0.x (for 8.0.29 onwards) and 7.0.x (for 7.0.66
onwards)

Regards,
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org