Upgrade the used JDK in the project to v21 (#3582)
* Upgrade the used JDK in the project to v21 * Use it for CI too * Centralise java language version * Fix deprecations, tests and lint issues * Fix coverage taking into account `@Preview` annotated code. --------- Co-authored-by: Benoit Marty <benoit@matrix.org>
This commit is contained in:
committed by
GitHub
parent
9e5dc106c2
commit
60f1bf6e54
@@ -11,8 +11,14 @@ plugins {
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
sourceCompatibility = Versions.javaVersion
|
||||
targetCompatibility = Versions.javaVersion
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
languageVersion = Versions.javaLanguageVersion
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
package io.element.android.libraries.core.uri
|
||||
|
||||
import java.net.URL
|
||||
import java.net.URI
|
||||
|
||||
fun String.isValidUrl(): Boolean {
|
||||
return try {
|
||||
URL(this)
|
||||
URI(this).toURL()
|
||||
true
|
||||
} catch (t: Throwable) {
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user