Skip to content

rename to valid camel case and remove deprecated URL() #1175

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

Merged
merged 2 commits into from
May 6, 2025

Conversation

AndrewKis
Copy link
Contributor

@AndrewKis AndrewKis commented May 6, 2025

Closes #1169

@@ -240,7 +241,7 @@ internal object Parsers : GlobalParserOptions {
toJavaLocalDateTimeOrNull(formatter) // since we accept a Java DateTimeFormatter
?.toKotlinLocalDateTime()

private fun String.toUrlOrNull(): URL? = if (isUrl(this)) catchSilent { URL(this) } else null
private fun String.toUrlOrNull(): URL? = if (isUrl(this)) catchSilent { URI(this).toURL() } else null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toUrl?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Java API

@@ -110,7 +111,7 @@ public fun isProtocolSupported(url: URL): Boolean = url.protocol in setOf("http"
*/
public fun asUrl(fileOrUrl: String): URL =
if (isUrl(fileOrUrl)) {
URL(fileOrUrl).toURI()
URI(fileOrUrl)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uri?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Java API

Copy link
Collaborator

@Jolanrensen Jolanrensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you do a Ctrl+f across the /dev example notebooks? Just to be sure we don't also use this function there :)

@@ -180,7 +185,7 @@ internal interface ConvertDocs {
* `| `__`.`__[**`toInstant`**][Convert.toInstant]`()`
*
* {@include [Indent]}
* `| `__`.`__[**`toURL`**][Convert.toURL]`()`
* `| `__`.`__[**`toURL`**][Convert.toUrl]`()`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you missed the first part of the reference

@@ -956,20 +961,34 @@ public fun <T, R : URL?> Convert<T, URL>.toImg(width: Int? = null, height: Int?

// region toURL

@Deprecated(CONVERT_TO_URL, ReplaceWith(CONVERT_TO_URL_REPLACE))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might go to level = DeprecationLevel.ERROR directly, since we're breaking more stuff anyway

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot, thank you

@AndreiKingsley AndreiKingsley merged commit c0c7b7f into master May 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename ..URL in API to ..Url and replace URL() deprecated constructor
4 participants