diff --git a/spring-core/src/main/java/org/springframework/core/MethodParameter.java b/spring-core/src/main/java/org/springframework/core/MethodParameter.java index e6cb387c5905ae3469e7b13a319a9bc5866e5440..ea1cc4c631a2bb6fefa117d4fe8d0e67fc9177ee 100644 --- a/spring-core/src/main/java/org/springframework/core/MethodParameter.java +++ b/spring-core/src/main/java/org/springframework/core/MethodParameter.java @@ -668,7 +668,7 @@ public class MethodParameter { private static int validateIndex(Executable executable, int parameterIndex) { int count = executable.getParameterCount(); - Assert.isTrue(parameterIndex < count, () -> "Parameter index needs to be between 0 and " + (count - 1)); + Assert.isTrue(parameterIndex < count, () -> "Parameter index needs to be between -1 and " + (count - 1)); return parameterIndex; }