if (!(Http.Request.current() == null ? "" : Http.Request.current().format).equals(route.staticArgs.get("format"))) {
In short, it checks if the current request's format corresponds to the route's format and if it doesn't, considers the route is not eligible.
In my case, the current request is null since it's an asynchronous call, and the format is set to "html" because I set it statically.
(On a side note, I've done so because some browser or something tried to negociate other formats than HTML, and it generated exceptions because proper template files could not be found, so I forced output to be HTML)
So it looks like an asynchronous job is not able to generate a route with a static format set.
For now,I've changed this line to:
if (Http.Request.current() != null && !Http.Request.current().format.equals(route.staticArgs.get("format"))) {
so that the check if performed only if there is a request.
I'm not sure if it's a good solution in the general case and thus if it should be proposed as a patch.