I was trying to locally build grpc-kotlin because v1.4.2 didn't release yet on maven central repository but i wanted to test it.
while I did, I have noticed that gradle logged a warning during the first sync that using java.net.URL(string) was deprecated.
As i have tracked down the source of this deprecation warning, i noticed that it is coming from the build.gradle.kts of the stub sub-project. Apparently, java.net.URL was deprecated in Java 20, which is the reason i got this warning when trying to build it using the latest LTS release (21.0.4)
I have researched the deprecation warning as it was documented and deemed as unsafe on the Java 21 specification.
The easy and straight forward fix is to replace java.net.URL(string) with java.net.URI(string).toURL() in the gradle project file for the stub sub-project.
This change has no effect on the functionality or backwards compatibility as .toURL() already existed back in Java 8
I was trying to locally build grpc-kotlin because v1.4.2 didn't release yet on maven central repository but i wanted to test it. while I did, I have noticed that gradle logged a warning during the first sync that using
java.net.URL(string)
was deprecated.As i have tracked down the source of this deprecation warning, i noticed that it is coming from the
build.gradle.kts
of thestub
sub-project. Apparently,java.net.URL
was deprecated in Java 20, which is the reason i got this warning when trying to build it using the latest LTS release (21.0.4)I have researched the deprecation warning as it was documented and deemed as unsafe on the Java 21 specification.
The easy and straight forward fix is to replace
java.net.URL(string)
withjava.net.URI(string).toURL()
in the gradle project file for the stub sub-project.This change has no effect on the functionality or backwards compatibility as
.toURL()
already existed back in Java 8