Polishing

This commit is contained in:
Sam Brannen
2022-11-13 16:01:37 +01:00
parent 1f0a35bacc
commit eb91d21ada
13 changed files with 69 additions and 36 deletions

View File

@@ -34,12 +34,13 @@ import org.springframework.messaging.support.MessageHeaderAccessor;
/**
* {@link ReflectiveProcessor} implementation for {@link MessageMapping}
* annotated types. On top of registering reflection hints for invoking
* annotated types. In addition to registering reflection hints for invoking
* the annotated method, this implementation handles:
*
* <ul>
* <li>Return types.</li>
* <li>Parameters identified as potential payload.</li>
* <li>{@link Message} parameters.</li>
* <li>Return types</li>
* <li>Parameters identified as potential payloads</li>
* <li>{@link Message} parameters</li>
* </ul>
*
* @author Sebastien Deleuze
@@ -49,6 +50,7 @@ class MessageMappingReflectiveProcessor implements ReflectiveProcessor {
private final BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
@Override
public void registerReflectionHints(ReflectionHints hints, AnnotatedElement element) {
if (element instanceof Class<?> type) {
@@ -99,6 +101,8 @@ class MessageMappingReflectiveProcessor implements ReflectiveProcessor {
@Nullable
protected Type getMessageType(MethodParameter parameter) {
MethodParameter nestedParameter = parameter.nested();
return (nestedParameter.getNestedParameterType() == nestedParameter.getParameterType() ? null : nestedParameter.getNestedParameterType());
return (nestedParameter.getNestedParameterType() == nestedParameter.getParameterType() ?
null : nestedParameter.getNestedParameterType());
}
}