RFR: 8264200: java/nio/channels/DatagramChannel/SRTest.java fails intermittently [v2]

Conor Cleary ccleary at openjdk.java.net
Tue Apr 6 16:53:26 UTC 2021


On Tue, 6 Apr 2021 15:00:03 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8264200: Use charset consistently & correct logs
>
> test/jdk/java/nio/channels/DatagramChannel/SRTest.java line 195:
> 
>> 193:                 DatagramPacket dp = new DatagramPacket(buf, buf.length);
>> 194:                 ds.receive(dp);
>> 195:                 String received = new String(dp.getData(), US_ASCII);
> 
> That's not quite correct, you need to take into account the offset and length of the received data.

Ah... good spot, this results in a needlessly long string.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3354


More information about the nio-dev mailing list