polishing

This commit is contained in:
Mark Fisher
2011-02-04 15:50:47 -05:00
parent d52de1007c
commit 2346fa6f0a

View File

@@ -363,18 +363,17 @@ abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySuppor
"Could not convert request: no suitable HttpMessageConverter found for expected type ["
+ expectedType.getName() + "] and content type [" + contentType + "]");
}
private HttpStatus resolveHttpStatusFromHeaders(MessageHeaders headers){
Object httpStatusFromHeader =
headers.get(org.springframework.integration.http.HttpHeaders.STATUS_CODE);
private HttpStatus resolveHttpStatusFromHeaders(MessageHeaders headers) {
Object httpStatusFromHeader = headers.get(org.springframework.integration.http.HttpHeaders.STATUS_CODE);
HttpStatus httpStatus = null;
if (httpStatusFromHeader instanceof HttpStatus){
if (httpStatusFromHeader instanceof HttpStatus) {
httpStatus = (HttpStatus) httpStatusFromHeader;
}
else if (httpStatusFromHeader instanceof Integer){
else if (httpStatusFromHeader instanceof Integer) {
httpStatus = HttpStatus.valueOf((Integer) httpStatusFromHeader);
}
else if (httpStatusFromHeader instanceof String){
else if (httpStatusFromHeader instanceof String) {
httpStatus = HttpStatus.valueOf(Integer.parseInt((String) httpStatusFromHeader));
}
return httpStatus;