Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8051627: Invariants about java.net.URI resolve and relativize are wrong #9671

Closed
wants to merge 4 commits into from

Conversation

tkiriyama
Copy link
Contributor

@tkiriyama tkiriyama commented Jul 28, 2022

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires a CSR request to be approved

Issues

  • JDK-8051627: Invariants about java.net.URI resolve and relativize are wrong
  • JDK-8291462: Invariants about java.net.URI resolve and relativize are wrong (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9671/head:pull/9671
$ git checkout pull/9671

Update a local copy of the PR:
$ git checkout pull/9671
$ git pull https://git.openjdk.org/jdk pull/9671/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9671

View PR using the GUI difftool:
$ git pr show -t 9671

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9671.diff

@tkiriyama
Copy link
Contributor Author

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 28, 2022

👋 Welcome back tkiriyama! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jul 28, 2022
@openjdk
Copy link

openjdk bot commented Jul 28, 2022

@tkiriyama an approved CSR request is already required for this pull request.

@openjdk
Copy link

openjdk bot commented Jul 28, 2022

@tkiriyama The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Jul 28, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 29, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 29, 2022

Webrevs

@tkiriyama
Copy link
Contributor Author

Could anyone please reviwe this fix?

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are correct. Could you update the UriTest with some examples and counter-examples to validate this claim?

* <p> <i>Relativization</i>, finally, can be regarded as the inverse of resolution.
* Let <i>u</i> be any normalized absolute URI ending with a slash character ({@code '/'})
* and <i>v</i> be any normalized relative URI not beginning with a period character ({@code '.'})
* or slash character ({@code '/'}). Then, the following statement is true.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A colon ':' may be more appropriate than a period '.' at the end of this sentence:
I'd suggest:

Then, the following statement is true:

* </blockquote>
*
* Let <i>u</i> be any normalized absolute URI ending with a slash character ({@code '/'})
* and <i>v</i> be any normalized absolute URI. Then, the following statement is true.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark here.

@dfuch
Copy link
Member

dfuch commented Aug 11, 2022

/csr needed

@openjdk
Copy link

openjdk bot commented Aug 11, 2022

@dfuch an approved CSR request is already required for this pull request.

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 8, 2022

@tkiriyama This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@tkiriyama
Copy link
Contributor Author

@dfuch
Thank you for your review and suggestions.

A colon ':' may be more appropriate than a period '.' at the end of this sentence:
I'd suggest:

You’re right. I changed to use a colon.

Could you update the UriTest with some examples and counter-examples to validate this claim?

I added tests in URI/Test.java.
The tests include testing if the resolve-relativize relationship stand when the two URIs meet the condition of the modified javadoc.
The tests also include testing if the relationship does not stand when the two specific URIs which meets the condition of the original javadoc are given. These URIs are excluded by the condition of the modiied javadoc.

@dfuch
Copy link
Member

dfuch commented Sep 28, 2022

Hi @tkiriyama sorry for taking so long to get back to you. I had a look at the CSR - and fixed a few missing fields, and added myself as reviewer. Please move its state to "Proposed" to get this moving further.

@tkiriyama
Copy link
Contributor Author

@dfuch
Thank you for your reply.
I moved CSR's status to "PROPOSED". Please review it.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 27, 2022

@tkiriyama This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@tkiriyama
Copy link
Contributor Author

This pull request is waiting for the CSR.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Nov 3, 2022
@tkiriyama
Copy link
Contributor Author

@dfuch
The CSR of this pull request was moved to "CLOSED".
Could you review this pull request again?

@dfuch
Copy link
Member

dfuch commented Nov 24, 2022

Done! Thanks for reminding me.

@openjdk
Copy link

openjdk bot commented Nov 24, 2022

@tkiriyama This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8051627: Invariants about java.net.URI resolve and relativize are wrong

Reviewed-by: dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 979 new commits pushed to the master branch:

  • 3c4d520: 8296671: [JFR] jdk.ContainerConfiguration event should include host total memory
  • 8b73970: 8296208: AArch64: Enable SHA512 intrinsic by default on supported hardware
  • f4cf758: 8297491: Loom: Stack chunks allocation code uses TLABs even when TLABs are disabled
  • 5e5b774: 8296768: Use different explicit claim marks for CLDs in Parallel and Serial GC
  • 9c77e41: 8297445: PPC64: Represent Registers as values
  • 2f8a5c2: 8297480: GetPrimitiveArrayCritical in imageioJPEG misses result - NULL check
  • abeddab: 6528710: sRGB-ColorSpace to sRGB-ColorSpace Conversion
  • 09ac9eb: 8297533: ProblemList java/io/File/TempDirDoesNotExist.java test failing on windows-x64
  • 5325145: 8297529: ProblemList javax/swing/JFileChooser/8046391/bug8046391.java on windows-x64
  • 91cd8a0: 8297525: jdk/jshell/ToolBasicTest.java fails after JDK-8295984
  • ... and 969 more: https://git.openjdk.org/jdk/compare/9d6b0285f53599816c30393b87d16772ef6314b7...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dfuch) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 24, 2022
@dfuch
Copy link
Member

dfuch commented Nov 24, 2022

If you need a sponsor please drop a note here after integrating.

@tkiriyama
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 24, 2022
@openjdk
Copy link

openjdk bot commented Nov 24, 2022

@tkiriyama
Your change (at version a5bb23c) is now ready to be sponsored by a Committer.

@tkiriyama
Copy link
Contributor Author

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

@dfuch
Copy link
Member

dfuch commented Nov 24, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 24, 2022

Going to push as commit ab1f9ff.
Since your change was applied there have been 982 commits pushed to the master branch:

  • df6cf1e: 8296886: Fix various include sort order issues
  • 5e196b4: 8297476: Increase InlineSmallCode default from 1000 to 2500 for RISC-V
  • 070a84c: 8297192: Warning generating API docs for javax.management.MBeanServer: overridden methods do not document exception type
  • 3c4d520: 8296671: [JFR] jdk.ContainerConfiguration event should include host total memory
  • 8b73970: 8296208: AArch64: Enable SHA512 intrinsic by default on supported hardware
  • f4cf758: 8297491: Loom: Stack chunks allocation code uses TLABs even when TLABs are disabled
  • 5e5b774: 8296768: Use different explicit claim marks for CLDs in Parallel and Serial GC
  • 9c77e41: 8297445: PPC64: Represent Registers as values
  • 2f8a5c2: 8297480: GetPrimitiveArrayCritical in imageioJPEG misses result - NULL check
  • abeddab: 6528710: sRGB-ColorSpace to sRGB-ColorSpace Conversion
  • ... and 972 more: https://git.openjdk.org/jdk/compare/9d6b0285f53599816c30393b87d16772ef6314b7...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 24, 2022
@openjdk openjdk bot closed this Nov 24, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 24, 2022
@openjdk
Copy link

openjdk bot commented Nov 24, 2022

@dfuch @tkiriyama Pushed as commit ab1f9ff.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org
2 participants