ConversionService is able to apply Converters to interface-based array elements (SPR-7150); a context ConversionService is able to override an ApplicationContext's resource editors (SPR-7079)

This commit is contained in:
Juergen Hoeller
2010-05-26 13:58:37 +00:00
parent 6c6004a93b
commit 1532119787
8 changed files with 158 additions and 36 deletions

View File

@@ -147,7 +147,8 @@ public class GenericConversionService implements ConversionService, ConverterReg
logger.debug("Yes, I can convert");
}
return true;
} else {
}
else {
if (logger.isDebugEnabled()) {
logger.debug("No, I cannot convert");
}
@@ -252,7 +253,8 @@ public class GenericConversionService implements ConversionService, ConverterReg
logger.debug("Matched cached converter " + converter);
}
return converter != NO_MATCH ? converter : null;
} else {
}
else {
converter = findConverterForClassPair(sourceType, targetType);
if (converter != null) {
if (logger.isTraceEnabled()) {
@@ -374,6 +376,9 @@ public class GenericConversionService implements ConversionService, ConverterReg
if (componentType.getSuperclass() != null) {
classQueue.addFirst(Array.newInstance(componentType.getSuperclass(), 0).getClass());
}
else if (componentType.isInterface()) {
classQueue.addFirst(Object[].class);
}
}
else {
Class<?>[] interfaces = currentClass.getInterfaces();
@@ -441,6 +446,9 @@ public class GenericConversionService implements ConversionService, ConverterReg
if (componentType.getSuperclass() != null) {
classQueue.addFirst(Array.newInstance(componentType.getSuperclass(), 0).getClass());
}
else if (componentType.isInterface()) {
classQueue.addFirst(Object[].class);
}
}
else {
Class<?>[] interfaces = currentClass.getInterfaces();