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

pjfanning 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 3d07b5af3 remove deprecated javadsl route directive (#1105)
3d07b5af3 is described below

commit 3d07b5af39fc74d2887ea452f5858bdbe2ff0b47
Author: PJ Fanning <[email protected]>
AuthorDate: Sat Jun 27 16:09:12 2026 +0100

    remove deprecated javadsl route directive (#1105)
    
    * remove deprecated javadsl route directive
    
    * javafmt
    
    * issues
---
 .../javadsl/server/directives/RouteDirectivesTest.java  | 11 -----------
 .../remove-deprecated-methods.excludes                  |  2 ++
 .../apache/pekko/http/javadsl/server/Directives.scala   |  5 -----
 .../javadsl/server/directives/RouteDirectives.scala     | 17 -----------------
 4 files changed, 2 insertions(+), 33 deletions(-)

diff --git 
a/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java
 
b/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java
index 24ded1e9c..3cf5e5025 100644
--- 
a/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java
+++ 
b/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java
@@ -13,8 +13,6 @@
 
 package org.apache.pekko.http.javadsl.server.directives;
 
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
 import java.util.concurrent.CompletableFuture;
 import org.apache.pekko.http.javadsl.model.*;
 import org.apache.pekko.http.javadsl.model.headers.Location;
@@ -106,15 +104,6 @@ public class RouteDirectivesTest extends 
JUnitJupiterRouteTest {
                 + " `withSizeLimit`.");
   }
 
-  @Test
-  public void testEmptyRoutesConcatenation() {
-    assertThrows(
-        IllegalArgumentException.class,
-        () -> {
-          route();
-        });
-  }
-
   @Test
   public void testRouteFromFunction() {
     TestRoute route =
diff --git 
a/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
 
b/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
index cf8718174..6375262da 100644
--- 
a/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
+++ 
b/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
@@ -19,6 +19,8 @@
 
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.coding.Coder.encode")
 
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.Directives.extractUpgradeToWebSocket")
 
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.directives.WebSocketDirectives.extractUpgradeToWebSocket")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.Directives.route")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.directives.RouteDirectives.route")
 
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.RoutingSettings.getFileIODispatcher")
 
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.RoutingSettings.withFileIODispatcher")
 
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.unmarshalling.sse.EventStreamUnmarshalling.fromEventStream")
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 7a651ea15..b587a1dfc 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
@@ -33,11 +33,6 @@ object Directives extends AllDirectives {
   // These are repeated here since sometimes (?) the Scala compiler won't 
actually generate java-compatible
   // signatures for varargs methods, making them show up as Seq<Object> 
instead of T... in Java.
 
-  @Deprecated(since = "Akka HTTP 10.1.6")
-  @varargs
-  override def route(alternatives: Route*): Route =
-    super.route(alternatives: _*)
-
   @varargs override def getFromBrowseableDirectories(directories: String*): 
Route =
     super.getFromBrowseableDirectories(directories: _*)
 
diff --git 
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/RouteDirectives.scala
 
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/RouteDirectives.scala
index 0cd47ea2f..fc8d2832c 100644
--- 
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/RouteDirectives.scala
+++ 
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/RouteDirectives.scala
@@ -47,23 +47,6 @@ abstract class RouteDirectives extends RespondWithDirectives 
{
   // Don't try this at home – we only use it here for the java -> scala 
conversions
   private implicit val conversionExecutionContext: ExecutionContext = 
ExecutionContext.parasitic
 
-  /**
-   * Java-specific call added so you can chain together multiple alternate 
routes using comma,
-   * rather than having to explicitly call 
route1.orElse(route2).orElse(route3).
-   * @deprecated Use the `RouteDirectives.concat` method instead.
-   */
-  @Deprecated(since = "Akka HTTP 10.1.6")
-  @deprecated("Use the RouteDirectives.concat method instead.", "Akka HTTP 
10.1.6")
-  @CorrespondsTo("concat")
-  @varargs def route(alternatives: Route*): Route = RouteAdapter {
-    import pekko.http.scaladsl.server.Directives._
-
-    if (alternatives.isEmpty)
-      throw new IllegalArgumentException("Chaining empty list of routes is 
illegal.")
-
-    alternatives.map(_.delegate).reduce(_ ~ _)
-  }
-
   /**
    * Used to chain multiple alternate routes using comma,
    * rather than having to explicitly call 
route1.orElse(route2).orElse(route3).


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

Reply via email to