On Thu, 28 Jul 2022 06:48:56 GMT, KIRIYAMA Takuya <[email protected]> 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. This pull request has now been integrated. Changeset: ab1f9ffa Author: KIRIYAMA Takuya <[email protected]> Committer: Daniel Fuchs <[email protected]> URL: https://git.openjdk.org/jdk/commit/ab1f9ffa78ca95b67b6d57936a70c49abf18fd00 Stats: 57 lines in 2 files changed: 52 ins; 0 del; 5 mod 8051627: Invariants about java.net.URI resolve and relativize are wrong Reviewed-by: dfuchs ------------- PR: https://git.openjdk.org/jdk/pull/9671
