RFR: 8272215: Add InetAddress methods for parsing IP address literals

Aleksei Efimov aefimov at openjdk.org
Mon Oct 16 16:18:23 UTC 2023


On Tue, 10 Oct 2023 16:17:21 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

>> src/java.base/share/classes/java/net/Inet6Address.java line 525:
>> 
>>> 523:      *         parsed as an IPv6 address literal.
>>> 524:      * @throws NullPointerException if the {@code ipv6AddressLiteral} is {@code null}.
>>> 525:      */
>> 
>> Similar comment to Inet4Address. The snippet should be incorporated into the general class docs section "Textual representation of IP addresses" and the apidoc here should limit itself to any limitations that only apply to this method imo.
>
> My mistake, it looks like we don't support the octal or hexadecimal formats in the existing `getByName` method, which is good news!
> 
> But, I think the comments above still apply in terms of moving the snippets to the class level docs, and maybe specifying there also that we only support the decimal literals

That is a good point Michael. The snippets were moved to class-level javadocs, and were modified a bit to limit the number of examples, and other small changes. Pushed as [e95858e](https://github.com/openjdk/jdk/pull/15775/commits/e95858ebb6039e9b5bbbca2a4730fcbed78747ca).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15775#discussion_r1358130204


More information about the net-dev mailing list