RFR: 8284161: Implementation of Virtual Threads (Preview) [v7]

Alan Bateman alanb at openjdk.java.net
Wed Apr 27 06:26:50 UTC 2022


On Tue, 26 Apr 2022 18:58:23 GMT, Daniel Fuchs <dfuchs at openjdk.org> 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


More information about the core-libs-dev mailing list