-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
@@ -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 |
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.
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.
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) |
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.
Uri?
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.
It's Java API
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.
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]`()` |
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.
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)) |
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.
We might go to level = DeprecationLevel.ERROR
directly, since we're breaking more stuff anyway
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.
I forgot, thank you
Closes #1169