Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -162,7 +162,7 @@ public class DestinationPatternsMessageCondition extends AbstractMessageConditio
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<String> matches = new ArrayList<String>();
|
List<String> matches = new ArrayList<String>();
|
||||||
for (String pattern : patterns) {
|
for (String pattern : this.patterns) {
|
||||||
if (pattern.equals(destination) || this.pathMatcher.match(pattern, destination)) {
|
if (pattern.equals(destination) || this.pathMatcher.match(pattern, destination)) {
|
||||||
matches.add(pattern);
|
matches.add(pattern);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class PayloadArgumentResolver implements HandlerMethodArgumentResolver {
|
|||||||
if (ann == null || ann.required()) {
|
if (ann == null || ann.required()) {
|
||||||
String paramName = getParameterName(parameter);
|
String paramName = getParameterName(parameter);
|
||||||
BindingResult bindingResult = new BeanPropertyBindingResult(payload, paramName);
|
BindingResult bindingResult = new BeanPropertyBindingResult(payload, paramName);
|
||||||
bindingResult.addError(new ObjectError(paramName, "@Payload param is required"));
|
bindingResult.addError(new ObjectError(paramName, "Payload value must not be empty"));
|
||||||
throw new MethodArgumentNotValidException(message, parameter, bindingResult);
|
throw new MethodArgumentNotValidException(message, parameter, bindingResult);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ public abstract class AbstractMethodMessageHandler<T>
|
|||||||
for (T mapping : mappingsToCheck) {
|
for (T mapping : mappingsToCheck) {
|
||||||
T match = getMatchingMapping(mapping, message);
|
T match = getMatchingMapping(mapping, message);
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
matches.add(new Match(match, handlerMethods.get(mapping)));
|
matches.add(new Match(match, this.handlerMethods.get(mapping)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -57,7 +57,7 @@ public class SimpMessageTypeMessageCondition extends AbstractMessageCondition<Si
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<?> getContent() {
|
protected Collection<?> getContent() {
|
||||||
return Arrays.asList(messageType);
|
return Arrays.asList(this.messageType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,12 +72,10 @@ public class SimpMessageTypeMessageCondition extends AbstractMessageCondition<Si
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SimpMessageTypeMessageCondition getMatchingCondition(Message<?> message) {
|
public SimpMessageTypeMessageCondition getMatchingCondition(Message<?> message) {
|
||||||
|
|
||||||
Object actualMessageType = SimpMessageHeaderAccessor.getMessageType(message.getHeaders());
|
Object actualMessageType = SimpMessageHeaderAccessor.getMessageType(message.getHeaders());
|
||||||
if (actualMessageType == null) {
|
if (actualMessageType == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,4 +95,5 @@ public class SimpMessageTypeMessageCondition extends AbstractMessageCondition<Si
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user