Skip to content

PayloadArgumentResolver enforces Validator unnecessarily [SPR-12567] #17168

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions