Restore formatting change following revert

This commit is contained in:
Rossen Stoyanchev
2018-08-17 09:53:47 +03:00
parent 498984324d
commit ad88c02bc3
2 changed files with 7 additions and 4 deletions

View File

@@ -281,8 +281,7 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
inputMessage, outputMessage);
if (body != null) {
if (logger.isDebugEnabled()) {
Object formatted = (body instanceof CharSequence ? "\"" + body + "\"" : body);
logger.debug("Writing [" + formatted + "]");
logger.debug("Writing [" + formatValue(body) + "]");
}
addContentDispositionHeader(inputMessage, outputMessage);
if (genericConverter != null) {
@@ -399,6 +398,10 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceTypeToUse) <= 0 ? acceptType : produceTypeToUse);
}
static String formatValue(Object body) {
return (body instanceof CharSequence ? "\"" + body + "\"" : body.toString());
}
/**
* Check if the path has a file extension and whether the extension is
* either {@link #WHITELISTED_EXTENSIONS whitelisted} or explicitly

View File

@@ -885,8 +885,8 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
mavContainer = (ModelAndViewContainer) asyncManager.getConcurrentResultContext()[0];
asyncManager.clearConcurrentResult();
if (logger.isDebugEnabled()) {
logger.debug("Resume with async result [" +
(result instanceof CharSequence ? "\"" + result + "\"" : result) + "]");
String formatted = AbstractMessageConverterMethodProcessor.formatValue(result);
logger.debug("Resume with async result [" + formatted + "]");
}
invocableMethod = invocableMethod.wrapConcurrentResult(result);
}