Skip to content

Commit 7c99f48

Browse files
authored
remove final remove-final-pekko.util.JavaDurationConverters use (#793)
1 parent da0cf7e commit 7c99f48

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

http-core/src/main/scala/org/apache/pekko/http/impl/settings/WebSocketSettingsImpl.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import pekko.annotation.InternalApi
2020
import pekko.http.impl.engine.ws.Randoms
2121
import pekko.http.impl.util._
2222
import pekko.util.ByteString
23-
import pekko.util.JavaDurationConverters._
2423
import com.typesafe.config.Config
2524

2625
import scala.concurrent.duration.Duration
@@ -40,7 +39,7 @@ private[pekko] final case class WebSocketSettingsImpl(
4039
s"Unsupported keep-alive mode detected! Was [$periodicKeepAliveMode], yet only: ${WebSocketSettingsImpl.KeepAliveModes} are supported.")
4140

4241
override def getPeriodicKeepAliveMaxIdle: java.time.Duration =
43-
periodicKeepAliveMaxIdle.asJava
42+
JavaDurationConverter.toJava(periodicKeepAliveMaxIdle)
4443
override def productPrefix = "WebSocketSettings"
4544

4645
}

http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/WebSocketSettings.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import pekko.actor.ActorSystem
2222
import pekko.annotation.DoNotInherit
2323
import pekko.http.impl.settings.WebSocketSettingsImpl
2424
import pekko.util.ByteString
25-
import pekko.util.JavaDurationConverters._
2625
import com.typesafe.config.Config
2726

2827
import scala.concurrent.duration.Duration
28+
import scala.jdk.DurationConverters._
2929

3030
/**
3131
* Public API but not intended for subclassing
@@ -60,7 +60,7 @@ trait WebSocketSettings { self: WebSocketSettingsImpl =>
6060
* @since 1.3.0
6161
*/
6262
def withPeriodicKeepAliveMaxIdle(newValue: JDuration): WebSocketSettings =
63-
copy(periodicKeepAliveMaxIdle = newValue.asScala)
63+
copy(periodicKeepAliveMaxIdle = newValue.toScala)
6464
def withPeriodicKeepAliveData(newValue: Supplier[ByteString]): WebSocketSettings =
6565
copy(periodicKeepAliveData = () => newValue.get())
6666

0 commit comments

Comments
 (0)