PayloadArgumentResolver enforces Validator unnecessarily [SPR-12567] #17168
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
Gary Russell opened SPR-12567 and commented
The
PayloadArgumentResolver
constructor asserts that theValidator
is not null, but thevalidate()
method treats a nullValidator
as a no-op.This forces users, such as the
SimpAnnotationMethodMessageHandler
andDefaultMessageHandlerMethodFactory
to inject aNoOpValidator
(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
The text was updated successfully, but these errors were encountered: