-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix for IllegalArgumentException: URI is not absolute #12186 #12246
base: main
Are you sure you want to change the base?
Conversation
… to a URL in the create method. This prevents the IllegalArgumentException: URI is not absolute error by throwing a MalformedURLException with a descriptive message if the URI is not absolute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code currently does not meet JabRef's code guidelines.
We use OpenRewrite to ensure "modern" Java coding practices.
The issues found can be automatically fixed.
Please execute the gradle task rewriteRun
, check the results, commit, and push.
You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".
@koppor Could you please review the PR? I have resolved the bug that was present. Regarding the failing test case, it fails even when I run the script on the main branch's code. Could you check if this is an error on your side? Thank you |
Are you talking about the failing openrewrite test? |
Yes, I’m talking about the openrewrite test.
…On Sat, 30 Nov 2024 at 10:52 AM, Subhramit Basu Bhowmick < ***@***.***> wrote:
Regarding the failing test case, it fails even when I run the script on
the main branch's code. Could you check if this is an error on your side?
Thank you
Are you talking about the failing openrewrite test?
—
Reply to this email directly, view it on GitHub
<#12246 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASS7DS3XSSYKYJZC2WPW4F32DFDRTAVCNFSM6AAAAABSXWZ6MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBYHAZTONZTGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Did you try fixing it? Following what is written in the bot message? |
I tried using the gradle rewriterun, but it just removed the library for
assert equals from the import and didn’t help me, pass the tests. Is there
any other workaround or docs to be followed?
…On Sat, 30 Nov 2024 at 10:56 AM, Subhramit Basu Bhowmick < ***@***.***> wrote:
Yes, I’m talking about the openrewrite test.
Did you try fixing it? Following what is written in the bot message?
Also ref.
https://devdocs.jabref.org/code-howtos/faq.html#failing-openrewrite-tests
—
Reply to this email directly, view it on GitHub
<#12246 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASS7DS6ZTIILIYTN7CGTUPL2DFEAXAVCNFSM6AAAAABSXWZ6MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBYHAZTSMBTGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Use the gradle sidebar and double click on the task as shown in the link. |
Thank You, this worked out!
…On Sat, Nov 30, 2024 at 11:02 AM Subhramit Basu Bhowmick < ***@***.***> wrote:
I tried using the gradle rewriterun, but it just removed the library for
assert equals from the import and didn’t help me, pass the tests. Is there
any other workaround or docs to be followed?
Use the gradle sidebar and double click on the task as shown in the link.
—
Reply to this email directly, view it on GitHub
<#12246 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASS7DSZRANIWQ6NWTARPGH32DFEXRAVCNFSM6AAAAABSXWZ6MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBYHA2DANZUGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also fix the submodules committed:
https://devdocs.jabref.org/code-howtos/faq.html#submodules
Co-authored-by: Subhramit Basu Bhowmick <[email protected]>
Could you share the content of your JAVA_HOME setting? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a solution. JabRef should work with these "relative" URLs, too.
@koppor , This update does work with "realative" urls, can you please clarify a little or give some case, which I didn't cover? Thank You |
The example of #12186 (comment) should give no error, but work. Web page can be opened etc. |
Closing this issue due to inactivity 💤 Please ping us if you intend to resume work on this one. |
Hi Oliver, I actually want to work on the issue, just got busy with some
work, will finish it by this week.
…On Tue, Dec 10, 2024 at 6:53 PM Oliver Kopp ***@***.***> wrote:
Closing this issue due to inactivity 💤
Please ping us if you intend to resume work on this one.
—
Reply to this email directly, view it on GitHub
<#12246 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASS7DS4UACT74RNSF4RPKSL2E3TLTAVCNFSM6AAAAABSXWZ6MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZRGYZDMMJZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This PR closes: #12186
Added a check to ensure that the URI is absolute before converting it to a URL in the create method. This prevents the IllegalArgumentException: URI is not absolute error by throwing a MalformedURLException with a descriptive message if the URI is not absolute.
Description
This PR addresses a bug where the
create
method would throw anIllegalArgumentException
if the URI was not absolute.Changes
src/main/java/org/jabref/logic/util/URLUtil.java
create
method to ensure that the URI is absolute before converting it to a URL.IllegalArgumentException: URI is not absolute
error by throwing aMalformedURLException
with a descriptive message if the URI is not absolute.Detailed Explanation
MalformedURLException
.This ensures that only valid absolute URIs are converted to URLs, preventing the error you encountered.
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)