Replace java.net.URL
with alternative, e.g. java.net.URI
#2993
Labels
configuration
An issue/PR related to Dokka's configuration by the user
enhancement
An issue for a feature or an overall improvement
tech-debt
A technical issue that is not observable by the users, but improves maintainers quality of life
Is your feature request related to a problem? Please describe
Dokka Generator uses
java.net.URL
in the configuration.dokka/core/src/main/kotlin/configuration.kt
Lines 226 to 230 in 3fc8b83
dokka/core/src/main/kotlin/configuration.kt
Lines 250 to 255 in 3fc8b83
java.net.URL
has a number of drawbacks and unexpected behaviours.java.net.URL
serialization depends onhashCode
which creates cache misses gradle/gradle#24979URL.hashCode()
is blocking.equals()
is not performantDescribe the solution you'd like
Here are some suggestions:
Replace all usages of
java.net.URL
withjava.net.URI
Replace all usages of
java.net.URL
withString
, and annotate it with@Language("http-url-reference")
so IntelliJ recognises it as a URLCreate a custom class named something like
WebUrl
orHttpLink
Use another library's URL, e.g.
ui.ktor.http.Url
Describe alternatives you've considered
Dokkatoo can work around this and use an alternative, as it 'hides' the Dokka configuration from Gradle.
Ideally Dokka would also be updated, for consistency.
Additional context
See also
Are you willing to provide a PR?
Sure thing
(cc @martinbonnin)
The text was updated successfully, but these errors were encountered: