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 09:30:46 GMT
On 17/05/2010 09:49, Konstantin Kolinko wrote:
> findChar() was the "correct" implementation.
> It is indexOf() that is 0-127.

Putting one side the error in my comments, I prefer the widening
conversion to the narrowing one for two reasons:
1. No chance of false positive on the match
2. It is what 3 out of 4 of the methods did before

> Thus the comments in r945014 and subsequent r945016 are wrong.

Agreed the comments are wrong (i can fix that) but I am happy with the
code changes.

> byte is signed. Widening byte -> char preserves the sign, thus
> comparing (byte == char) does not work for the upper part of
> ISO-8859-1.

We could fix that but given the current usage, I am happy with just
supporting 0-127.

Mark



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


Mime
View raw message