New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadsl RouteDirectives.route() with no args will throw java.lang.UnsupportedOperationException: empty.reduceLeft #1170

Closed
jrudolph opened this Issue May 29, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@jrudolph
Copy link
Member

jrudolph commented May 29, 2017

Reported in #1168 (comment).

This should be illegal. We should probably

  1. deprecate that signature:
@varargs def route(alternatives: Route*): Route 
  1. and add another one
@varargs def route(first: Route, alternatives: Route*): Route 
  1. add a better runtime exception if someone uses the existing one in the wrong way

@ktoso ktoso added 3 - in progress and removed 1 - triaged labels Jul 2, 2018

ktoso added a commit that referenced this issue Sep 16, 2018

Add new method for routes chaining in Java DSL (#1170) (#2100)
* Adds new method for chaining together multiple routes, deprecates old RouteDirectives.route and Directives.route, adds additional check for deprecated RouteDirectives.route to make sure that Array of routes is not empty

* Adds test case for RouteDirectives.route call without specifying any route

* Replaces all of RouteDirectives.route usage with new implementation RouteDirectives.routes

* Ignores new RouteDirectives.routes method for the directives consistency check

* Replaces require with if statement to minimize overhead, updates javadoc

* Renames RouteDirectives.routes to RouteDirectives.concat, updates Routing DSL documentation for Java

* Marks RouteDirectives.route method with scala @deprecated annotation

* Removes CorrespondsTo annotation from a RouteDirectives.concat method because naming is the same as Scala dsl

@ktoso ktoso added this to the 10.1.6 milestone Sep 16, 2018

@ktoso ktoso removed the 3 - in progress label Sep 16, 2018

Synesso added a commit to Synesso/akka-http that referenced this issue Sep 17, 2018

Add new method for routes chaining in Java DSL (akka#1170) (akka#2100)
* Adds new method for chaining together multiple routes, deprecates old RouteDirectives.route and Directives.route, adds additional check for deprecated RouteDirectives.route to make sure that Array of routes is not empty

* Adds test case for RouteDirectives.route call without specifying any route

* Replaces all of RouteDirectives.route usage with new implementation RouteDirectives.routes

* Ignores new RouteDirectives.routes method for the directives consistency check

* Replaces require with if statement to minimize overhead, updates javadoc

* Renames RouteDirectives.routes to RouteDirectives.concat, updates Routing DSL documentation for Java

* Marks RouteDirectives.route method with scala @deprecated annotation

* Removes CorrespondsTo annotation from a RouteDirectives.concat method because naming is the same as Scala dsl

@jrudolph jrudolph added bug 1 - triaged and removed 1 - triaged labels Nov 22, 2018

@jrudolph

This comment has been minimized.

Copy link
Member

jrudolph commented Nov 22, 2018

Fixed by #2100 afaics.

@jrudolph jrudolph closed this Nov 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment