Skip to content

Commit 18c63f7

Browse files
author
Keith Donald
committed
polishing
1 parent f751ace commit 18c63f7

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public void addFormatterForFieldAnnotation(final AnnotationFormatterFactory anno
7373
public Class<?>[][] getConvertibleTypes() {
7474
return new Class<?>[][] {{fieldType, String.class}};
7575
}
76-
public boolean matches(TypeDescriptor sourceFieldType, TypeDescriptor targetFieldType) {
77-
return (sourceFieldType.getAnnotation(annotationType) != null);
76+
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
77+
return (sourceType.getAnnotation(annotationType) != null);
7878
}
7979
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
8080
Printer<?> printer = annotationFormatterFactory.getPrinter(sourceType.getAnnotation(annotationType), sourceType.getType());
@@ -89,8 +89,8 @@ public String toString() {
8989
public Class<?>[][] getConvertibleTypes() {
9090
return new Class<?>[][] {{String.class, fieldType}};
9191
}
92-
public boolean matches(TypeDescriptor sourceFieldType, TypeDescriptor targetFieldType) {
93-
return (targetFieldType.getAnnotation(annotationType) != null);
92+
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
93+
return (targetType.getAnnotation(annotationType) != null);
9494
}
9595
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
9696
Parser<?> parser = annotationFormatterFactory.getParser(targetType.getAnnotation(annotationType), targetType.getType());

org.springframework.core/src/main/java/org/springframework/core/convert/support/ConversionServiceFactory.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
package org.springframework.core.convert.support;
1818

19-
import org.springframework.core.convert.ConversionService;
20-
import org.springframework.core.convert.converter.ConverterRegistry;
2119

2220
/**
23-
* A factory for creating common ConversionService configurations.
21+
* A factory for common ConversionService configurations.
2422
*
2523
* @author Keith Donald
2624
* @author Juergen Hoeller
@@ -31,15 +29,14 @@ public abstract class ConversionServiceFactory {
3129
/**
3230
* Create a new default ConversionService instance that can be safely modified.
3331
*/
34-
public static ConversionService createDefaultConversionService() {
32+
public static GenericConversionService createDefaultConversionService() {
3533
GenericConversionService conversionService = new GenericConversionService();
3634
addDefaultConverters(conversionService);
3735
return conversionService;
3836
}
3937

4038
/**
4139
* Populate the given ConversionService instance with all applicable default converters.
42-
* Callers may cast the returned ConversionService to a {@link ConverterRegistry} to supplement or override the default converters.
4340
*/
4441
public static void addDefaultConverters(GenericConversionService conversionService) {
4542
conversionService.addGenericConverter(new ArrayToArrayConverter(conversionService));

0 commit comments

Comments
 (0)