SPR-8718 Revert fix from earlier for now (need a different approach).
This commit is contained in:
@@ -485,7 +485,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private final class ConverterAdapter implements ConditionalGenericConverter {
|
||||
private final class ConverterAdapter implements GenericConverter {
|
||||
|
||||
private final ConvertiblePair typeInfo;
|
||||
|
||||
@@ -500,11 +500,6 @@ public class GenericConversionService implements ConfigurableConversionService {
|
||||
return Collections.singleton(this.typeInfo);
|
||||
}
|
||||
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
return (typeInfo.getTargetType().equals(targetType.getObjectType()) &&
|
||||
typeInfo.getSourceType().isAssignableFrom(sourceType.getObjectType()));
|
||||
}
|
||||
|
||||
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
if (source == null) {
|
||||
return convertNullSource(sourceType, targetType);
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.convert.ConversionFailedException;
|
||||
import org.springframework.core.convert.ConverterNotFoundException;
|
||||
@@ -209,6 +210,7 @@ public class GenericConversionServiceTests {
|
||||
// SPR-8718
|
||||
|
||||
@Test(expected=ConverterNotFoundException.class)
|
||||
@Ignore("TODO")
|
||||
public void convertSuperTarget() {
|
||||
conversionService.addConverter(new ColorConverter());
|
||||
conversionService.convert("#000000", SystemColor.class);
|
||||
|
||||
Reference in New Issue
Block a user