[jdk21u-dev] RFR: 8338748: [17u, 21u] Test Disconnect.java compile error: cannot find symbol after JDK-8299813 [v2]
SendaoYan
syan at openjdk.org
Mon Sep 9 14:14:29 UTC 2024
On Mon, 9 Sep 2024 09:53:41 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> change Inet4Address.getByName and Inet6Address.getByName to InetAddress.getByName
>
> test/jdk/java/nio/channels/DatagramChannel/Disconnect.java line 55:
>
>> 53: // test with IPv4 only
>> 54: try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)) {
>> 55: InetAddress lo4 = Inet4Address.getByName("127.0.0.1");
>
> `Inet4Address` doesn't override `getByName()` we should use `InetAddress` instead.
>
> Suggestion:
>
> InetAddress lo4 = InetAddress.getByName("127.0.0.1");
Thanks for the review. Inet4Address.getByName and Inet6Address.getByName has been change to InetAddress.getByName.
The change has been verified locally.
> test/jdk/java/nio/channels/DatagramChannel/Disconnect.java line 65:
>
>> 63: // test with IPv6 only
>> 64: try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET6)) {
>> 65: InetAddress lo6 = Inet6Address.getByName("::1");
>
> Suggestion:
>
> InetAddress lo6 = InetAddress.getByName("::1");
Same to above.
-------------
PR Review Comment: https://git.openjdk.org/jdk21u-dev/pull/939#discussion_r1750349154
PR Review Comment: https://git.openjdk.org/jdk21u-dev/pull/939#discussion_r1750349649
More information about the jdk-updates-dev
mailing list