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

Replace java.net.URL with alternative, e.g. java.net.URI #2993

Open
aSemy opened this issue May 4, 2023 · 1 comment
Open

Replace java.net.URL with alternative, e.g. java.net.URI #2993

aSemy opened this issue May 4, 2023 · 1 comment
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

Comments

@aSemy
Copy link
Contributor

aSemy commented May 4, 2023

Is your feature request related to a problem? Please describe

Dokka Generator uses java.net.URL in the configuration.

interface SourceLinkDefinition : Serializable {
val localDirectory: String
val remoteUrl: URL
val remoteLineSuffix: String?
}

interface ExternalDocumentationLink : Serializable {
val url: URL
val packageListUrl: URL
companion object
}

java.net.URL has a number of drawbacks and unexpected behaviours.

Describe the solution you'd like

Here are some suggestions:

  1. Replace all usages of java.net.URL with java.net.URI

  2. Replace all usages of java.net.URL with String, and annotate it with @Language("http-url-reference") so IntelliJ recognises it as a URL

  3. Create a custom class named something like WebUrl or HttpLink

    class Website(private val value: String)
  4. 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)

@aSemy aSemy added the enhancement An issue for a feature or an overall improvement label May 4, 2023
@IgnatBeresnev IgnatBeresnev added tech-debt A technical issue that is not observable by the users, but improves maintainers quality of life configuration An issue/PR related to Dokka's configuration by the user labels May 19, 2023
@whyoleg
Copy link
Contributor

whyoleg commented Dec 21, 2023

Exploration regarding removal of deprecated URL constructor: 521d9e5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants