mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 09:52:09 +01:00
remove usages of new URL() as constructor is deprecated on jdk 20+ (#5219)
This commit is contained in:
parent
3ae41032a4
commit
c6524b9246
@ -83,7 +83,7 @@ object JsonReaders {
|
||||
implicit object URLReads extends Reads[URL] {
|
||||
|
||||
override def reads(json: JsValue): JsResult[URL] =
|
||||
SerializerUtil.processJsString[URL](str => new URL(str))(json)
|
||||
SerializerUtil.processJsString[URL](str => new URI(str).toURL)(json)
|
||||
}
|
||||
|
||||
implicit object ZonedDateTimeReads extends Reads[ZonedDateTime] {
|
||||
|
@ -5,7 +5,7 @@ import org.bitcoins.core.util._
|
||||
import org.bitcoins.crypto.StringFactory
|
||||
import scodec.bits.ByteVector
|
||||
|
||||
import java.net.URL
|
||||
import java.net.{URI, URL}
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
||||
class LnURL private (private val str: String) {
|
||||
@ -13,7 +13,7 @@ class LnURL private (private val str: String) {
|
||||
val url: URL = LnURL.decode(str) match {
|
||||
case Failure(_) =>
|
||||
throw new IllegalArgumentException("Invalid LnURL encoding")
|
||||
case Success(value) => new URL(value)
|
||||
case Success(value) => new URI(value).toURL
|
||||
}
|
||||
|
||||
override def toString: String = str.toUpperCase
|
||||
|
Loading…
Reference in New Issue
Block a user