-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Remove calls to deprecated URL constructor #4551
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mark Herwege <[email protected]>
Signed-off-by: Mark Herwege <[email protected]>
Signed-off-by: Mark Herwege <[email protected]>
Signed-off-by: Mark Herwege <[email protected]>
Signed-off-by: Mark Herwege <[email protected]>
Signed-off-by: Mark Herwege <[email protected]>
@@ -215,7 +215,7 @@ protected List<Addon> getRemoteAddons() { | |||
|
|||
// retrieve from remote | |||
try { | |||
URL url = new URL(String.format("%s%s", COMMUNITY_TOPIC_URL, uid.replace(ADDON_ID_PREFIX, ""))); | |||
URL url = URI.create(String.format("%s%s", COMMUNITY_TOPIC_URL, uid.replace(ADDON_ID_PREFIX, ""))).toURL(); |
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.
While you're there, String.format("%s%s", COMMUNITY_TOPIC_URL, uid.replace(ADDON_ID_PREFIX, ""))
could be replaced by "%s%s".formatted(COMMUNITY_TOPIC_URL, uid.replace(ADDON_ID_PREFIX, ""))
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.
Done
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.
Or COMMUNITY_TOPIC_URL + uid.replace(ADDON_ID_PREFIX, "")
😉
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.
Obviously
Signed-off-by: Mark Herwege <[email protected]>
Signed-off-by: Mark Herwege <[email protected]>
As part of #4546, it was pointed out the
URL
constructor has been deprecated in Java 21.This PR removes all uses of the URL constructor in core.
It starts from #4546, which only looks at one class in
HttpUtil
(and also solves a different problem), so that should be reviewed first (and this one rebased afterwards).@holgerfriedrich Let me know what you think.