RFR: 8332686: InetAddress.ofLiteral can throw StringIndexOutOfBoundsException [v2]
Jaikiran Pai
jpai at openjdk.org
Wed Dec 4 02:08:39 UTC 2024
On Tue, 3 Dec 2024 17:32:13 GMT, Aleksei Efimov <aefimov at openjdk.org> wrote:
>> The proposed change fixes `InetAddress.ofLiteral` and `Inet6Address.ofLiteral` to throw `IllegalArgumentException` instead of `StringIndexOutOfBoundsException` when an empty IP addres literal string is specified.
>> The `Inet4Address.ofLiteral` correctly throws `IllegalArgumentException` when a literal cannot be parsed as an IPv4 address literal. It was addressed before in [JDK-8315767](https://bugs.openjdk.org/browse/JDK-8315767) fix.
>>
>> Testing: the modified `OfLiteralTest` test and other tests from `jdk-tier1` to `jdk-tier3` tiers
>
> Aleksei Efimov has updated the pull request incrementally with two additional commits since the last revision:
>
> - IA.ofLiteral - no need to try parsing as IPv4 and IPv6 literal if string is empty.
> - Add test cases for blank string literals
Thank you for the update Aleksei. This looks good to me.
-------------
Marked as reviewed by jpai (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/22518#pullrequestreview-2477105826
More information about the net-dev
mailing list