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

[4.x] Fixes a jar-only URL resolution bug #7748

Merged

Conversation

ljnelson
Copy link
Member

@ljnelson ljnelson commented Oct 6, 2023

This PR corrects a flaw where persistence roots were not being properly inferred from URLs pointing at META-INF/persistence.xml locations.

In prior versions, prior to the JDK's deprecation of new URL(someOtherUrl, "..") invocations, something in that recipe handled jar URLs transparently. When I changed this to work on URI objects as the deprecation warnings suggested, suddenly jar URLs were not handled transparently.

This PR ensures that, for example, the inferring of a persistence root from a URI of jar:file:///path/some.jar!/META-INF/persistence.xml will correctly be file:///path/some.jar.

(In addition, the PR hoists this calculation out of a loop where it was incorrectly located for an embarrassingly long time.)

The PR also adds a unit test demonstrating some of the more amazing and interesting features of jar URIs.

Documentation impact: none

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson added bug Something isn't working P1 jpa/jta must-have java Pull requests that update Java code 4.x Version 4.x labels Oct 6, 2023
@ljnelson ljnelson self-assigned this Oct 6, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 6, 2023
@ljnelson ljnelson added this to Sprint Scope in Backlog Oct 6, 2023
Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson merged commit a95f9e9 into helidon-io:main Oct 7, 2023
12 checks passed
Backlog automation moved this from Sprint Scope to Closed Oct 7, 2023
dalexandrov pushed a commit to dalexandrov/helidon that referenced this pull request Oct 17, 2023
Fixes a jar-only URL resolution bug

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x bug Something isn't working java Pull requests that update Java code jpa/jta must-have OCA Verified All contributors have signed the Oracle Contributor Agreement. P1
Projects
Backlog
  
Closed
Development

Successfully merging this pull request may close these issues.

None yet

2 participants