RFR: 8293590: Some syntax checks performed by URL.openConnection() could be performed earlier, at URL construction [v3]
Alan Bateman
alanb at openjdk.org
Fri Oct 7 11:04:16 UTC 2022
On Fri, 7 Oct 2022 08:42:43 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Daniel Fuchs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>>
>> - Merge branch 'master' into url-early-parsing-8293590
>> - Merge branch 'master' into url-early-parsing-8293590
>> - 8293590
>
> At a high-level I think this proposal is okay and rejecting nonsense URLs early is the right thing to do. Having MalformedURLException thrown if the "parsed URL fails to comply with the specific syntax of the associated protocol" already sets expectations that the input will be rejected at URL construction time.
>
> As regards the compatibility impact then it should be low. Code that creates a bad URL and opens a connection may not notice the change, except maybe that an exception is thrown in a different place. Code that creates bad URLs but doesn't attempt to open connections may get an exception when they didn't previously but it should be rare and there is a system property to work around the behavior change until the code is fixed to use the correct URL syntax. So overall I think this is okay.
> Thanks @AlanBateman ! Do I have your approval then?
I've added myself as Reviewer to the CSR.
-------------
PR: https://git.openjdk.org/jdk/pull/10534
More information about the net-dev
mailing list