filterRegex with multiple arguments - filter invoked multiple times?

19 views
Skip to first unread message

Saša Živkov

unread,
May 10, 2021, 12:57:46 PM5/10/21
to google-guice
What is the intended behavior for a binding like:

filterRegex(R1, R2).through(MyFilter.class); ?

I observe that this is internally translated into:
filterRegex(R1).through(MyFilter.class);
filterRegex(R2).through(MyFilter.class);

Which means that when a request matches both R1 and R2 regexes then MyFilter will
be invoked 2 times, once for matching R1 and once for matching R2.

However, I hoped that the filterRegex with varargs is more than just a convenience and that
it would only invoke MyFilter at most once (when any of the given regexes matches).
Anyway, is there a way to achieve that?
Reply all
Reply to author
Forward
0 new messages