Skip to content

Commit e71ff29

Browse files
committed
Polishing
1 parent d9c1811 commit e71ff29

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spring-web/src/test/java/org/springframework/web/method/ResolvableMethod.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,18 @@ private void addFilter(String message, Predicate<Method> filter) {
277277
* Filter on methods with the given name.
278278
*/
279279
public Builder<T> named(String methodName) {
280-
addFilter("methodName=" + methodName, m -> m.getName().equals(methodName));
280+
addFilter("methodName=" + methodName, method -> method.getName().equals(methodName));
281281
return this;
282282
}
283283

284284
/**
285285
* Filter on methods with the given parameter types.
286+
* @since 5.1
286287
*/
287288
public Builder<T> argTypes(Class<?>... argTypes) {
288-
addFilter("argTypes=" + Arrays.toString(argTypes), m ->
289-
ObjectUtils.isEmpty(argTypes) ?
290-
m.getParameterTypes().length == 0 : Arrays.equals(m.getParameterTypes(), argTypes));
289+
addFilter("argTypes=" + Arrays.toString(argTypes), method ->
290+
ObjectUtils.isEmpty(argTypes) ? method.getParameterCount() == 0 :
291+
Arrays.equals(method.getParameterTypes(), argTypes));
291292
return this;
292293
}
293294

0 commit comments

Comments
 (0)