Skip to content

PayloadArgumentResolver enforces Validator unnecessarily [SPR-12567] #17168

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
spring-projects-issues opened this issue Dec 23, 2014 · 0 comments
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Gary Russell opened SPR-12567 and commented

The PayloadArgumentResolver constructor asserts that the Validator is not null, but the validate() method treats a null Validator as a no-op.

This forces users, such as the SimpAnnotationMethodMessageHandler and DefaultMessageHandlerMethodFactory to inject a NoOpValidator (private static class in each case).

Given the protection in the validate() method, it appears that the assertion can be relaxed (and perhaps add a ctor that just takes the converter).


Affects: 4.0.8, 4.1.3

Referenced from: commits ed0e2f4, 9362d0d

Backported to: 4.0.9

@spring-projects-issues spring-projects-issues added in: messaging Issues in messaging modules (jms, messaging) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.4 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants