Be more resilient to ParameterNameProviders that return too few parameter names

Description

While triaging a Spring Boot issue, I've learned that Hibernate Validator fails with an ArrayIndexOutOfBoundsException if a ParameterNameProvider returns fewer names than the Method or Constructor has arguments. While the javadoc doesn't specifically say that the number of names returned should match the number of parameters (or be zero), I think this is a bug in the name provider. However, I wondered if you might want to consider making Hibernate Validator a little more resilient in the face of a misbehaving name provider.

Environment

None

Status

Assignee

Unassigned

Reporter

Andy Wilkinson

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Affects versions

Priority

Minor
Configure