On Tue, 26 Apr 2022 18:58:23 GMT, Daniel Fuchs <[email protected]> wrote:
>> Alan Bateman has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Refresh 8d8f0a2fd646e57fe6b4e8ab669f836dc46dda69
>
> src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java line 770:
>
>> 768: synchronized (p) {
>> 769: DatagramPackets.setLength(p, n);
>> 770: p.setSocketAddress(sender);
>
> Hmmm... For integrity it might be better to call the public
> `DatagramPacket::setData(byte[] buf, int offset, int length)` method here
> now. The additional advantage is that the private access to
> `DatagramPackets.setLength(p, n);` will no longer be needed.
DatagramPackets.setLength is not really new, it's just moved. There's a flaw in
DatagramPacket that forces its usage - the details are in JDK-8232817.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8166