8338748: [17u,21u] Test Disconnect.java compile error: cannot find symbol after JDK-8299813

Reviewed-by: sgehwolf
This commit is contained in:
SendaoYan
2024-09-10 07:58:19 +00:00
committed by Vitaly Provodin
parent 8eb71b87b1
commit 0f1effe4d2

View File

@@ -52,7 +52,7 @@ public class Disconnect {
if (IPSupport.hasIPv4()) {
// test with IPv4 only
try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)) {
InetAddress lo4 = InetAddress.ofLiteral("127.0.0.1");
InetAddress lo4 = InetAddress.getByName("127.0.0.1");
System.out.println("Testing with INET family and " + lo4);
test(dc, lo4);
test(dc, lo4);
@@ -62,7 +62,7 @@ public class Disconnect {
if (IPSupport.hasIPv6()) {
// test with IPv6 only
try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET6)) {
InetAddress lo6 = InetAddress.ofLiteral("::1");
InetAddress lo6 = InetAddress.getByName("::1");
System.out.println("Testing with INET6 family and " + lo6);
test(dc, lo6);
test(dc, lo6);