tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Williams <nicho...@nicholaswilliams.net>
Subject Re: svn commit: r1497552 - /tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
Date Thu, 27 Jun 2013 23:22:48 GMT

On Jun 27, 2013, at 6:14 PM, Konstantin Kolinko wrote:

> 2013/6/28  <markt@apache.org>:
>> Author: markt
>> Date: Thu Jun 27 20:10:40 2013
>> New Revision: 1497552
>> 
>> URL: http://svn.apache.org/r1497552
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55151
>> Fix bugs in test
>> 
>> Modified:
>>    tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
>> 
>> Modified: tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
>> URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java?rev=1497552&r1=1497551&r2=1497552&view=diff
>> ==============================================================================
>> --- tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
(original)
>> +++ tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
Thu Jun 27 20:10:40 2013
>> @@ -108,7 +108,7 @@ public class TestEncodingDecoding extend
>>         Assert.assertEquals(MESSAGE_ONE,
>>                 ((MsgString) MsgStringMessageHandler.received.peek()).getData());
>>         Assert.assertEquals(MESSAGE_ONE,
>> -                ((MsgString) client.received.peek()).getData());
>> +                new String(((MsgByte) client.received.peek()).getData()));
> 
> It is "new String(byte[])" here. It would be better with explicit
> encoding name such as "ISO-8859-1".

Or with a Charset instance, if you have one, because that's immune from an encoding unlike
a String charset name. If the charset is always going to be fixed here, this is Java 7 so
you could use StandardCharsets.UTF8, etc.

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


Mime
View raw message