mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8272215: Add InetAddress methods for parsing IP address literals
Reviewed-by: dfuchs, michaelm
This commit is contained in:
parent
a9b31b587c
commit
77fe0fd9e6
6 changed files with 606 additions and 82 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,7 +25,6 @@
|
|||
|
||||
package java.net;
|
||||
|
||||
import java.net.*;
|
||||
import java.util.Formatter;
|
||||
import java.util.Locale;
|
||||
import sun.net.util.IPAddressUtil;
|
||||
|
@ -137,7 +136,7 @@ class HostPortrange {
|
|||
}
|
||||
this.ipv4 = this.literal = ipv4;
|
||||
if (ipv4) {
|
||||
byte[] ip = IPAddressUtil.validateNumericFormatV4(hoststr);
|
||||
byte[] ip = IPAddressUtil.validateNumericFormatV4(hoststr, false);
|
||||
if (ip == null) {
|
||||
throw new IllegalArgumentException("illegal IPv4 address");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue