Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Mark Thomas
On 28/11/2014 19:07, Konstantin Kolinko wrote: > 2014-11-28 21:29 GMT+03:00 Mark Thomas : >> On 28/11/2014 17:47, Konstantin Kolinko wrote: >> >> Thanks for the review. I think I've addressed everything. >> > > public int hashCode() { > final int prime = 31; > in

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Konstantin Kolinko
2014-11-28 21:29 GMT+03:00 Mark Thomas : > On 28/11/2014 17:47, Konstantin Kolinko wrote: > > Thanks for the review. I think I've addressed everything. > public int hashCode() { final int prime = 31; int result = 1; result = prime * result + lcKey.ha

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Mark Thomas
On 28/11/2014 18:39, Christopher Schultz wrote: > Mark, > > On 11/28/14 12:06 PM, Mark Thomas wrote: >> On 28/11/2014 15:44, Rémy Maucherat wrote: >>> 2014-11-28 16:20 GMT+01:00 Martin Grigorov :I'm not >>> sure I follow you. >>> Assuming 'headers' is an instance of CaseInsensitiveKeyMap then

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Christopher Schultz
Mark, On 11/28/14 12:06 PM, Mark Thomas wrote: > On 28/11/2014 15:44, Rémy Maucherat wrote: >> 2014-11-28 16:20 GMT+01:00 Martin Grigorov :I'm not >> sure I follow you. >> >>> Assuming 'headers' is an instance of CaseInsensitiveKeyMap then: >>> - headers.get("BLAH") will delegate to innerMap.get(k

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Mark Thomas
On 28/11/2014 17:47, Konstantin Kolinko wrote: Thanks for the review. I think I've addressed everything. > 2014-11-28 17:53 GMT+03:00 : >> Author: markt >> Date: Fri Nov 28 14:53:15 2014 >> New Revision: 1642307 Cheers, Mark ---

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Konstantin Kolinko
2014-11-28 17:53 GMT+03:00 : > Author: markt > Date: Fri Nov 28 14:53:15 2014 > New Revision: 1642307 > > URL: http://svn.apache.org/r1642307 > Log: > Add a map that supports case insensitive keys. E.g. for use with HTTP headers. > > Added: > tomcat/trunk/java/org/apache/tomcat/websocket/CaseI

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Mark Thomas
On 28/11/2014 15:44, Rémy Maucherat wrote: > 2014-11-28 16:20 GMT+01:00 Martin Grigorov :I'm not > sure I follow you. > >> Assuming 'headers' is an instance of CaseInsensitiveKeyMap then: >> - headers.get("BLAH") will delegate to innerMap.get(key{"blah"}) // >> Perl-ish syntax to express what I

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Rémy Maucherat
2014-11-28 16:20 GMT+01:00 Martin Grigorov :I'm not sure I follow you. > Assuming 'headers' is an instance of CaseInsensitiveKeyMap then: > - headers.get("BLAH") will delegate to innerMap.get(key{"blah"}) // > Perl-ish syntax to express what I mean > - headers.get("bLAh") will also delegate to i

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Martin Grigorov
Hi Remy, On Fri, Nov 28, 2014 at 4:13 PM, Rémy Maucherat wrote: > 2014-11-28 16:05 GMT+01:00 Martin Grigorov : > > > Hi, > > > > Performance wise isn't it better to transform the String key to lowerCase > > at Key construction time and later use it in equals/hashCode ? > > Now the lower-ificatio

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Rémy Maucherat
2014-11-28 16:05 GMT+01:00 Martin Grigorov : > Hi, > > Performance wise isn't it better to transform the String key to lowerCase > at Key construction time and later use it in equals/hashCode ? > Now the lower-ification would happen for most Map operation. > The current is not spec compliant sinc

Re: svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread Martin Grigorov
Hi, Performance wise isn't it better to transform the String key to lowerCase at Key construction time and later use it in equals/hashCode ? Now the lower-ification would happen for most Map operation. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Nov 28,

svn commit: r1642307 - in /tomcat/trunk: java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java test/org/apache/tomcat/websocket/TestCaseInsensitiveKeyMap.java

2014-11-28 Thread markt
Author: markt Date: Fri Nov 28 14:53:15 2014 New Revision: 1642307 URL: http://svn.apache.org/r1642307 Log: Add a map that supports case insensitive keys. E.g. for use with HTTP headers. Added: tomcat/trunk/java/org/apache/tomcat/websocket/CaseInsensitiveKeyMap.java (with props) tomca