On Fri, 26 Aug 2022 09:55:11 GMT, Jaikiran Pai <[email protected]> wrote:
>> Can I please get a review of this javadoc only change for >> `DatagramPacket#setLength()` method? This addresses >> https://bugs.openjdk.org/browse/JDK-7113208. >> >> I haven't create a CSR because the javadoc was already stating the correct >> behaviour in the `@throws` documentation as follows: >> >>> @throws IllegalArgumentException if the length is negative, >> * or if the length plus the offset is greater than the >> * length of the packet's data buffer. >> >> This commit merely fixes the main part of the javadoc. > > Jaikiran Pai has updated the pull request incrementally with one additional > commit since the last revision: > > implement review comment src/java.base/share/classes/java/net/DatagramPacket.java line 416: > 414: public synchronized void setLength(int length) { > 415: Preconditions.checkFromIndexSize(offset, length, buf.length, > 416: > Preconditions.outOfBoundsExceptionFormatter(IllegalArgumentException::new)); Thanks for that. Maybe the bound checks in public synchronized void setData(byte[] buf, int offset, int length) { could be replaced in a similar way. ------------- PR: https://git.openjdk.org/jdk/pull/10037
