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: [email protected]
Reporter: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]