You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By allowing construction of an OrRequestMatcher/AndRequestMatcher from a List<? extends RequestMatcher>, the following expressions would compile:
new OrRequestMatcher(Stream.of(new AntPathRequestMatcher("foo")).toList());
Current Behavior
The expression doesn't compile, because Java infers the type List<AntPathRequestMatcher> for the parameter value, and there is no constructor accepting that type.
Context
With complex generic expressions (which are common when using the Java Streams API), explicit type parameters must be used to use the two matchers:
new OrRequestMatcher(Stream.<RequestMatcher>of(new AntPathRequestMatcher("foo")).toList());
This is hard to write and even harder to read in more complex cases.