DefaultConversionService properly converts Object[] to int[]

Closes gh-22410
This commit is contained in:
Juergen Hoeller
2019-02-14 13:38:29 +01:00
parent 3e1b3c32e3
commit 109eaf3a16
2 changed files with 108 additions and 99 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.util.ClassUtils;
/**
* Internal utilities for the conversion package.
@@ -59,7 +60,7 @@ abstract class ConversionUtils {
// yes
return true;
}
if (sourceElementType.getType().isAssignableFrom(targetElementType.getType())) {
if (ClassUtils.isAssignable(sourceElementType.getType(), targetElementType.getType())) {
// maybe
return true;
}