[2.x] Avoid the use of URL + Replace tuple with proper record type for licenses#7927
Merged
Conversation
**Problem** `java.net.URL` calls out to the network to perform `equals`, so we should remove that from anywhere that can be involved in caching etc. **Solution** This changes java.net.URL to java.net.URI in Keys.
Member
Author
|
I've signed Scala CLA a while back, so I'm not sure what the checker is saying. |
jtjeferreira
approved these changes
Dec 5, 2024
Contributor
jtjeferreira
left a comment
There was a problem hiding this comment.
LGTM, just 2 comments
| def uri(s: String): URI = new URI(s) | ||
| def file(s: String): File = new File(s) | ||
| def url(s: String): URL = new URI(s).toURL | ||
| def url(s: String): URI = new URI(s) |
Contributor
There was a problem hiding this comment.
what about keeping def url(s: String): URL, but add a Conversion[(String, URL), License], with a deprecated annotation to nudge people into moving to `URI?
Member
Author
There was a problem hiding this comment.
This is also for homepage, apiURL settings etc. Returning URI maintains the source compatibility, acting as a compat function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7736
See also #7753
Problem
java.net.URLcalls out to the network to performequals,so we should remove that from anywhere that can be involved in caching etc.
Solution