Don't use pattern matching in instanceof

The pattern matching for `instanceof` is available since Java 16
This commit is contained in:
Artem Bilan
2022-02-03 10:13:59 -05:00
parent 25e763d683
commit f1407544a2

View File

@@ -471,7 +471,8 @@ public abstract class AbstractHttpRequestExecutingMessageHandler extends Abstrac
if (value.getClass().isArray()) {
value = CollectionUtils.arrayToList(value);
}
if (value instanceof Collection<?> cValues) {
if (value instanceof Collection) {
Collection<?> cValues = (Collection<?>) value;
for (Object cValue : cValues) {
if (cValue != null && !(cValue instanceof String)) {
return true;