Merge branch '5.2.x'

# Conflicts:
#	spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java
This commit is contained in:
Juergen Hoeller
2020-09-25 11:36:18 +02:00
17 changed files with 233 additions and 115 deletions

View File

@@ -358,20 +358,7 @@ public class MessageTag extends HtmlEscapingAwareTag implements ArgumentAware {
@Nullable
protected Object[] resolveArguments(@Nullable Object arguments) throws JspException {
if (arguments instanceof String) {
String[] stringArray =
StringUtils.delimitedListToStringArray((String) arguments, this.argumentSeparator);
if (stringArray.length == 1) {
Object argument = stringArray[0];
if (argument != null && argument.getClass().isArray()) {
return ObjectUtils.toObjectArray(argument);
}
else {
return new Object[] {argument};
}
}
else {
return stringArray;
}
return StringUtils.delimitedListToStringArray((String) arguments, this.argumentSeparator);
}
else if (arguments instanceof Object[]) {
return (Object[]) arguments;
@@ -395,7 +382,7 @@ public class MessageTag extends HtmlEscapingAwareTag implements ArgumentAware {
* @throws IOException if writing failed
*/
protected void writeMessage(String msg) throws IOException {
this.pageContext.getOut().write(String.valueOf(msg));
this.pageContext.getOut().write(msg);
}
/**

View File

@@ -20,7 +20,6 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
@@ -35,6 +34,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.http.HttpStatus;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.context.WebApplicationContext;
@@ -456,12 +456,12 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
boolean first = (targetUrl.toString().indexOf('?') < 0);
for (Map.Entry<String, Object> entry : queryProperties(model).entrySet()) {
Object rawValue = entry.getValue();
Collection<Object> values;
Collection<?> values;
if (rawValue != null && rawValue.getClass().isArray()) {
values = Arrays.asList(ObjectUtils.toObjectArray(rawValue));
values = CollectionUtils.arrayToList(rawValue);
}
else if (rawValue instanceof Collection) {
values = ((Collection<Object>) rawValue);
values = ((Collection<?>) rawValue);
}
else {
values = Collections.singleton(rawValue);