Skip to content

Rely on standard parameter name resolution in Bean Validation 3.0 #29566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jhoeller opened this issue Nov 24, 2022 · 0 comments
Closed

Rely on standard parameter name resolution in Bean Validation 3.0 #29566

jhoeller opened this issue Nov 24, 2022 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

Following up on #29531 and #29563, it turns out that Hibernate Validator is aggressively introspection parameter names for every constructor/method parameter that it discovers, even if those parameters are standard JDK types. This not only leads to many warn log entries, it also indicates that we are parsing JDK class files to find out about parameter names which are effectively not needed (since Hibernate Validator does not actually need them for those parameter types).

Additionally, Bean Validation 3.0 / Hibernate Validator 7.0 (which is the minimum requirement as of Spring Framework 6.0) has built-in parameter name resolution based on standard Java 8 reflection itself, including a fallback to the generated arg names there. As a consequence, we do not need to repeat Java 8 reflection on top but may rather just override it with Kotlin reflection, and never fall back to ASM-based class file parsing for debug symbols.

@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Nov 24, 2022
@jhoeller jhoeller added this to the 6.0.2 milestone Nov 24, 2022
@jhoeller jhoeller self-assigned this Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant