RFR: 8349705: java.net.URI.scanIPv4Address throws unnecessary URISyntaxException [v2]

Xiaolong Peng xpeng at openjdk.org
Mon Feb 10 11:50:11 UTC 2025


On Mon, 10 Feb 2025 10:49:34 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Xiaolong Peng has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address PR comments
>
> src/java.base/share/classes/java/net/URI.java line 3469:
> 
>> 3467:                 return q;
>> 3468:             }
>> 3469:             fail("Malformed IPv4 address", q);
> 
> I am a bit uncomfortable with this change. I notice that the caller happens to catch the exception and return -1 only in the case where strict == false; In order to minimize the behavior changes suggest to do instead:
> 
> if (strict) fail("Malformed IPv4 address", q);

Thanks, you are right, I didn't notice that tiny difference in behavior, I have taken your suggestion and updated the PR, appreciate it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23538#discussion_r1948914657


More information about the net-dev mailing list