This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-http.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f2221ebe fix some more compiler warnings about deprecations (#817)
9f2221ebe is described below

commit 9f2221ebe250af6ac475608c293e5d7579012c0a
Author: PJ Fanning <[email protected]>
AuthorDate: Fri Oct 3 11:02:44 2025 +0100

    fix some more compiler warnings about deprecations (#817)
---
 .../test/scala/org/apache/pekko/http/impl/util/WithLogCapturing.scala  | 2 +-
 .../test/scala/org/apache/pekko/http/scaladsl/coding/GzipSpec.scala    | 3 ---
 .../main/scala/org/apache/pekko/http/javadsl/server/Directives.scala   | 2 --
 .../apache/pekko/http/javadsl/server/directives/HeaderDirectives.scala | 2 +-
 4 files changed, 2 insertions(+), 7 deletions(-)

diff --git 
a/http-core/src/test/scala/org/apache/pekko/http/impl/util/WithLogCapturing.scala
 
b/http-core/src/test/scala/org/apache/pekko/http/impl/util/WithLogCapturing.scala
index 4be422b6e..e67204af5 100644
--- 
a/http-core/src/test/scala/org/apache/pekko/http/impl/util/WithLogCapturing.scala
+++ 
b/http-core/src/test/scala/org/apache/pekko/http/impl/util/WithLogCapturing.scala
@@ -117,7 +117,7 @@ trait WithLogCapturing extends SuiteMixin { this: TestSuite 
=>
         override def write(b: Int): Unit = oldOut.write(b)
       }) {
         override def println(x: Any): Unit =
-          oldOut.println(prefix + String.valueOf(x).replaceAllLiterally("\n", 
s"\n$prefix"))
+          oldOut.println(prefix + String.valueOf(x).replace("\n", 
s"\n$prefix"))
       }
 
     Console.withOut(prefixingOut) {
diff --git 
a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/GzipSpec.scala
 
b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/GzipSpec.scala
index 79de51d87..ada29ac59 100644
--- 
a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/GzipSpec.scala
+++ 
b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/GzipSpec.scala
@@ -16,13 +16,10 @@ package org.apache.pekko.http.scaladsl.coding
 import java.io.{ InputStream, OutputStream }
 import java.util.zip.{ GZIPInputStream, GZIPOutputStream, ZipException }
 
-import scala.annotation.nowarn
-
 import org.apache.pekko
 import pekko.http.impl.util._
 import pekko.util.ByteString
 
-@nowarn("msg=deprecated .* is internal API")
 class GzipSpec extends CoderSpec {
   protected def Coder: Coder = Coders.Gzip(compressionLevel = 9)
 
diff --git 
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala 
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
index 734ac62d7..ce0e4a3e9 100644
--- a/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
+++ b/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
@@ -15,7 +15,6 @@ package org.apache.pekko.http.javadsl.server
 
 import java.util.function.{ BiFunction, Function, Supplier }
 
-import scala.annotation.nowarn
 import scala.annotation.varargs
 
 import org.apache.pekko
@@ -36,7 +35,6 @@ object Directives extends AllDirectives {
 
   @Deprecated
   @varargs
-  @nowarn("msg=route in class RouteDirectives is deprecated")
   override def route(alternatives: Route*): Route =
     super.route(alternatives: _*)
 
diff --git 
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/HeaderDirectives.scala
 
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/HeaderDirectives.scala
index 9cba36bf9..91e9fbe27 100644
--- 
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/HeaderDirectives.scala
+++ 
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/HeaderDirectives.scala
@@ -144,7 +144,7 @@ abstract class HeaderDirectives extends FutureDirectives {
    */
   def optionalHeaderValueByName(headerName: String, inner: 
jf.Function[Optional[String], Route]) = RouteAdapter {
     D.optionalHeaderValueByName(headerName) { value =>
-      inner.apply(value.asJava).delegate
+      inner.apply(value.toJava).delegate
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to