Skip to content

Commit 5528c8a

Browse files
committed
Polishing
1 parent c9912f0 commit 5528c8a

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandler.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,16 @@ public MessageConverter getMessageConverter() {
144144
}
145145

146146
/**
147-
* Configure a {@link ConversionService} to use when resolving method arguments, for
148-
* example message header values.
147+
* Configure a {@link ConversionService} to use when resolving method arguments,
148+
* for example message header values.
149149
* <p>By default an instance of {@link DefaultFormattingConversionService} is used.
150150
*/
151151
public void setConversionService(ConversionService conversionService) {
152152
this.conversionService = conversionService;
153153
}
154154

155155
/**
156-
* The configured {@link ConversionService}.
156+
* Return the configured {@link ConversionService}.
157157
*/
158158
public ConversionService getConversionService() {
159159
return this.conversionService;
@@ -162,22 +162,22 @@ public ConversionService getConversionService() {
162162
/**
163163
* Set the PathMatcher implementation to use for matching destinations
164164
* against configured destination patterns.
165-
* <p>By default AntPathMatcher is used
165+
* <p>By default, {@link AntPathMatcher} is used.
166166
*/
167167
public void setPathMatcher(PathMatcher pathMatcher) {
168168
Assert.notNull(pathMatcher, "PathMatcher must not be null");
169169
this.pathMatcher = pathMatcher;
170170
}
171171

172172
/**
173-
* Return the PathMatcher implementation to use for matching destinations
173+
* Return the PathMatcher implementation to use for matching destinations.
174174
*/
175175
public PathMatcher getPathMatcher() {
176176
return this.pathMatcher;
177177
}
178178

179179
/**
180-
* The configured Validator instance
180+
* Return the configured Validator instance.
181181
*/
182182
public Validator getValidator() {
183183
return this.validator;
@@ -283,17 +283,17 @@ protected boolean isHandler(Class<?> beanType) {
283283
@Override
284284
protected SimpMessageMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {
285285
MessageMapping typeAnnotation = AnnotationUtils.findAnnotation(handlerType, MessageMapping.class);
286-
MessageMapping messageAnnot = AnnotationUtils.findAnnotation(method, MessageMapping.class);
287-
if (messageAnnot != null) {
288-
SimpMessageMappingInfo result = createMessageMappingCondition(messageAnnot);
286+
MessageMapping messageAnnotation = AnnotationUtils.findAnnotation(method, MessageMapping.class);
287+
if (messageAnnotation != null) {
288+
SimpMessageMappingInfo result = createMessageMappingCondition(messageAnnotation);
289289
if (typeAnnotation != null) {
290290
result = createMessageMappingCondition(typeAnnotation).combine(result);
291291
}
292292
return result;
293293
}
294-
SubscribeMapping subsribeAnnotation = AnnotationUtils.findAnnotation(method, SubscribeMapping.class);
295-
if (subsribeAnnotation != null) {
296-
SimpMessageMappingInfo result = createSubscribeCondition(subsribeAnnotation);
294+
SubscribeMapping subscribeAnnotation = AnnotationUtils.findAnnotation(method, SubscribeMapping.class);
295+
if (subscribeAnnotation != null) {
296+
SimpMessageMappingInfo result = createSubscribeCondition(subscribeAnnotation);
297297
if (typeAnnotation != null) {
298298
result = createMessageMappingCondition(typeAnnotation).combine(result);
299299
}
@@ -348,11 +348,10 @@ public int compare(SimpMessageMappingInfo info1, SimpMessageMappingInfo info2) {
348348
protected void handleMatch(SimpMessageMappingInfo mapping, HandlerMethod handlerMethod,
349349
String lookupDestination, Message<?> message) {
350350

351-
SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.wrap(message);
352-
353351
String matchedPattern = mapping.getDestinationConditions().getPatterns().iterator().next();
354352
Map<String, String> vars = getPathMatcher().extractUriTemplateVariables(matchedPattern, lookupDestination);
355353

354+
SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.wrap(message);
356355
headers.setHeader(DestinationVariableMethodArgumentResolver.DESTINATION_TEMPLATE_VARIABLES_HEADER, vars);
357356
message = MessageBuilder.withPayload(message.getPayload()).setHeaders(headers).build();
358357

0 commit comments

Comments
 (0)