RFR: 8051627: Invariants about java.net.URI resolve and relativize are wrong [v2]

KIRIYAMA Takuya duke at openjdk.org
Thu Nov 24 12:13:54 UTC 2022


On Fri, 16 Sep 2022 07:20:08 GMT, KIRIYAMA Takuya <duke at openjdk.org> wrote:

>> The current documentation of URI class describes relationship between resolve and relativize methods as follows.
>> 
>> 
>> For any two normalized URIs u and v,
>>     u.relativize(u.resolve(v)).equals(v) and
>>     u.resolve(u.relativize(v)).equals(v) .
>> 
>> 
>> However, there are some cases where this relationship is not true. For example, when u and v are "http://a/b" and "c/d", respectively, both u.relativize(u.resolve(v)) and u.resolve(u.relativize(v)) equal to "http://a/c/d" not "c/d". The documentation should be updated to avoid confusion by describing the relationship between resolve nd relativize methods under certain conditions of the URI. Note that these conditions are sufficient but not necessary for the statement.
>
> KIRIYAMA Takuya 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 four additional commits since the last revision:
> 
>  - 8051627: Invariants about java.net.URI resolve and relativize are wrong
>  - Merge branch 'master' into 8051627
>  - 8051627: Invariants about java.net.URI resolve and relativize are wrong
>  - 8051627: Invariants about java.net.URI resolve and relativize are wrong

Thank you for your review. Could you sponsor this pull request, please?

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

PR: https://git.openjdk.org/jdk/pull/9671


More information about the net-dev mailing list