Skip to content

Commit d48bc3e

Browse files
authored
fix URL constructor deprecation warning (#627)
* fix URL deprecation warning fixes the constructor deprecation of `java.net.URL` that first appeared in java 20 by replacing it with `java.net.URI.toURL()` * fix(lint): shorten line length of dokka remote source url * fix(lint): removed empty line 78 in build.gradle.kts
1 parent 2f717db commit d48bc3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stub/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import com.google.protobuf.gradle.*
22
import org.jetbrains.dokka.gradle.DokkaTask
3-
import java.net.URL
3+
import java.net.URI
44

55
plugins {
66
alias(libs.plugins.dokka)
@@ -75,11 +75,15 @@ tasks.create<Jar>("javadocJar") {
7575
}
7676

7777
tasks.withType<DokkaTask>().configureEach {
78+
val remoteSourceUrl = URI(
79+
"https://github.com/grpc/grpc-kotlin/blob/master/stub/src/main/java"
80+
).toURL()
81+
7882
dokkaSourceSets {
7983
named("main") {
8084
sourceLink {
8185
localDirectory.set(file("src/main/java"))
82-
remoteUrl.set(URL("https://github.com/grpc/grpc-kotlin/blob/master/stub/src/main/java"))
86+
remoteUrl.set(remoteSourceUrl)
8387
remoteLineSuffix.set("#L")
8488
}
8589

0 commit comments

Comments
 (0)