RFR: 8051627: Invariants about java.net.URI resolve and relativize are wrong
KIRIYAMA Takuya
duke at openjdk.org
Sun Aug 7 23:59:58 UTC 2022
On Thu, 28 Jul 2022 06:48:56 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.
Could anyone please reviwe this fix?
-------------
PR: https://git.openjdk.org/jdk/pull/9671
More information about the net-dev
mailing list