Java 20 deprecation cleanup
This commit is contained in:
parent
e0a2c62600
commit
9bbd5fd03c
2 changed files with 5 additions and 4 deletions
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
|
@ -21,7 +21,7 @@
|
|||
</option>
|
||||
<option name="skipTestSources" value="false" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="18" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="20" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -41,7 +41,8 @@ import okhttp3.logging.HttpLoggingInterceptor
|
|||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import java.net.MalformedURLException
|
||||
import java.net.URL
|
||||
import java.net.URI
|
||||
import java.net.URISyntaxException
|
||||
import java.util.logging.Level
|
||||
import java.util.logging.Logger
|
||||
|
||||
|
@ -163,9 +164,9 @@ object Utils {
|
|||
fun String.isValidUrl(): Boolean {
|
||||
if (this.isNotBlank()) {
|
||||
try {
|
||||
URL(this)
|
||||
URI(this)
|
||||
return true
|
||||
} catch (e: MalformedURLException) {
|
||||
} catch (e: URISyntaxException) {
|
||||
if (logger.isLoggable(Level.WARNING)) {
|
||||
logger.log(Level.WARNING, "Invalid URL: $this", e)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue