On Wed, 1 Apr 2026 15:58:18 GMT, Daniel Fuchs <[email protected]> wrote:
>> May I get a review for this change that converts `java/net/DatagramSocket`
>> TestNG tests to use JUnit.
>>
>> Some of these tests now take advantage from the fact that Closeable
>> arguments passed to a ParameterizedTest are automatically closed by JUnit.
>
> Daniel Fuchs has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Review feedback
test/jdk/java/net/DatagramSocket/ConnectPortZero.java line 79:
> 77: @MethodSource("testCases")
> 78: public void testConnect(DatagramSocket socket, InetAddress addr) {
> 79: try (var ds = socket) {
Just as side note, it would also be possible to write this as `try (ds) { ...
}`, this way you would avoid introducing an additional local variable
(respectively having to change the method param name).
(In case that is desired.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30502#discussion_r3024412819