tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r944918 - /tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java
Date Mon, 17 May 2010 07:50:29 GMT
On 17/05/2010 00:03, Konstantin Kolinko wrote:
> 2010/5/17  <markt@apache.org>:
>> Author: markt
>> Date: Sun May 16 21:31:57 2010
>> New Revision: 944918
>>
>> URL: http://svn.apache.org/viewvc?rev=944918&view=rev
>> Log:
>> Code clean-up
>>
>> Modified:
>>    tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java
>>
> 
>> +    public static int indexOf(byte bytes[], int start, int end, char c) {
>> +        return findChar(bytes, start, end, c);
>>     }
> 
> There is a difference in behaviour between ByteChunk#indexOf(..) and
> ByteChunk#findChar(..) how they were implemented before this change.
> 
> indexOf() relied on (byte == char) comparison, which performs widening.
> findChar() does byte b=(byte)c; and compares bytes.
> 
> The difference is that indexOf() can find ASCII (0-127) characters
> only, while findChar() can find any ISO-8859-1 char.

Thanks for the catch. I'll restore the original behaviour and add some
comments to make this clearer.

Mark



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


Mime
View raw message