Skip to content

Commit c8c0e82

Browse files
committed
Polish trailing whitespace
1 parent 29d6044 commit c8c0e82

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

spring-core/src/main/java/org/springframework/core/convert/support/DefaultConversionService.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public DefaultConversionService() {
4343
}
4444

4545
// static utility methods
46-
46+
4747
/**
4848
* Add converters appropriate for most environments.
4949
* @param converterRegistry the registry of converters to add to (must also be castable to ConversionService)
@@ -54,9 +54,9 @@ public static void addDefaultConverters(ConverterRegistry converterRegistry) {
5454
addCollectionConverters(converterRegistry);
5555
addFallbackConverters(converterRegistry);
5656
}
57-
57+
5858
// internal helpers
59-
59+
6060
private static void addScalarConverters(ConverterRegistry converterRegistry) {
6161
converterRegistry.addConverter(new StringToBooleanConverter());
6262
converterRegistry.addConverter(Boolean.class, String.class, new ObjectToStringConverter());
@@ -65,16 +65,16 @@ private static void addScalarConverters(ConverterRegistry converterRegistry) {
6565
converterRegistry.addConverter(Number.class, String.class, new ObjectToStringConverter());
6666

6767
converterRegistry.addConverterFactory(new NumberToNumberConverterFactory());
68-
68+
6969
converterRegistry.addConverter(new StringToCharacterConverter());
7070
converterRegistry.addConverter(Character.class, String.class, new ObjectToStringConverter());
7171

7272
converterRegistry.addConverter(new NumberToCharacterConverter());
7373
converterRegistry.addConverterFactory(new CharacterToNumberFactory());
74-
74+
7575
converterRegistry.addConverterFactory(new StringToEnumConverterFactory());
7676
converterRegistry.addConverter(Enum.class, String.class, new EnumToStringConverter());
77-
77+
7878
converterRegistry.addConverter(new StringToLocaleConverter());
7979
converterRegistry.addConverter(Locale.class, String.class, new ObjectToStringConverter());
8080

@@ -83,13 +83,13 @@ private static void addScalarConverters(ConverterRegistry converterRegistry) {
8383
}
8484

8585
private static void addCollectionConverters(ConverterRegistry converterRegistry) {
86-
ConversionService conversionService = (ConversionService) converterRegistry;
86+
ConversionService conversionService = (ConversionService) converterRegistry;
8787
converterRegistry.addConverter(new ArrayToCollectionConverter(conversionService));
8888
converterRegistry.addConverter(new CollectionToArrayConverter(conversionService));
8989

9090
converterRegistry.addConverter(new ArrayToArrayConverter(conversionService));
9191
converterRegistry.addConverter(new CollectionToCollectionConverter(conversionService));
92-
converterRegistry.addConverter(new MapToMapConverter(conversionService));
92+
converterRegistry.addConverter(new MapToMapConverter(conversionService));
9393

9494
converterRegistry.addConverter(new ArrayToStringConverter(conversionService));
9595
converterRegistry.addConverter(new StringToArrayConverter(conversionService));
@@ -103,12 +103,12 @@ private static void addCollectionConverters(ConverterRegistry converterRegistry)
103103
converterRegistry.addConverter(new CollectionToObjectConverter(conversionService));
104104
converterRegistry.addConverter(new ObjectToCollectionConverter(conversionService));
105105
}
106-
106+
107107
private static void addFallbackConverters(ConverterRegistry converterRegistry) {
108108
ConversionService conversionService = (ConversionService) converterRegistry;
109109
converterRegistry.addConverter(new ObjectToObjectConverter());
110110
converterRegistry.addConverter(new IdToEntityConverter(conversionService));
111-
converterRegistry.addConverter(new FallbackObjectToStringConverter());
111+
converterRegistry.addConverter(new FallbackObjectToStringConverter());
112112
}
113113

114-
}
114+
}

spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,39 @@ public class GenericConversionServiceTests {
6161
public void canConvert() {
6262
assertFalse(conversionService.canConvert(String.class, Integer.class));
6363
conversionService.addConverterFactory(new StringToNumberConverterFactory());
64-
assertTrue(conversionService.canConvert(String.class, Integer.class));
64+
assertTrue(conversionService.canConvert(String.class, Integer.class));
6565
}
66-
66+
6767
@Test
6868
public void canConvertAssignable() {
6969
assertTrue(conversionService.canConvert(String.class, String.class));
7070
assertTrue(conversionService.canConvert(Integer.class, Number.class));
7171
assertTrue(conversionService.canConvert(boolean.class, boolean.class));
7272
assertTrue(conversionService.canConvert(boolean.class, Boolean.class));
7373
}
74-
74+
7575
@Test
7676
public void canConvertIllegalArgumentNullTargetType() {
7777
try {
7878
assertFalse(conversionService.canConvert(String.class, null));
7979
fail("Should have failed");
8080
} catch (IllegalArgumentException e) {
81-
81+
8282
}
8383
try {
8484
assertFalse(conversionService.canConvert(TypeDescriptor.valueOf(String.class), null));
8585
fail("Should have failed");
8686
} catch (IllegalArgumentException e) {
87-
87+
8888
}
8989
}
90-
90+
9191
@Test
9292
public void canConvertNullSourceType() {
9393
assertTrue(conversionService.canConvert(null, Integer.class));
9494
assertTrue(conversionService.canConvert(null, TypeDescriptor.valueOf(Integer.class)));
9595
}
96-
96+
9797
@Test
9898
public void convert() {
9999
conversionService.addConverterFactory(new StringToNumberConverterFactory());
@@ -208,7 +208,7 @@ public Integer convert(CharSequence source) {
208208
}
209209

210210
// SPR-8718
211-
211+
212212
@Test(expected=ConverterNotFoundException.class)
213213
public void convertSuperTarget() {
214214
conversionService.addConverter(new ColorConverter());
@@ -235,11 +235,11 @@ public void convertObjectToPrimitive() {
235235
public void convertObjectToPrimitiveViaConverterFactory() {
236236
assertFalse(conversionService.canConvert(String.class, int.class));
237237
conversionService.addConverterFactory(new StringToNumberConverterFactory());
238-
assertTrue(conversionService.canConvert(String.class, int.class));
238+
assertTrue(conversionService.canConvert(String.class, int.class));
239239
Integer three = conversionService.convert("3", int.class);
240240
assertEquals(3, three.intValue());
241241
}
242-
242+
243243
@Test
244244
public void genericConverterDelegatingBackToConversionServiceConverterNotFound() {
245245
conversionService.addConverter(new ObjectToArrayConverter(conversionService));
@@ -398,7 +398,7 @@ public void testPerformance1() {
398398
watch.stop();
399399
System.out.println(watch.prettyPrint());
400400
}
401-
401+
402402
@Test
403403
public void testPerformance2() throws Exception {
404404
GenericConversionService conversionService = new DefaultConversionService();
@@ -420,7 +420,7 @@ public void testPerformance2() throws Exception {
420420
target.add(Integer.valueOf(element));
421421
}
422422
}
423-
watch.stop();
423+
watch.stop();
424424
System.out.println(watch.prettyPrint());
425425
}
426426

@@ -435,7 +435,7 @@ public void testPerformance3() throws Exception {
435435
source.put("1", "1");
436436
source.put("2", "2");
437437
source.put("3", "3");
438-
TypeDescriptor td = new TypeDescriptor(getClass().getField("map"));
438+
TypeDescriptor td = new TypeDescriptor(getClass().getField("map"));
439439
for (int i = 0; i < 1000000; i++) {
440440
conversionService.convert(source, TypeDescriptor.forObject(source), td);
441441
}
@@ -447,10 +447,10 @@ public void testPerformance3() throws Exception {
447447
target.put(entry.getKey(), Integer.valueOf(entry.getValue()));
448448
}
449449
}
450-
watch.stop();
450+
watch.stop();
451451
System.out.println(watch.prettyPrint());
452452
}
453-
453+
454454
public static Map<String, Integer> map;
455455

456456
@Test
@@ -554,19 +554,19 @@ public void stringToArrayCanConvert() {
554554
conversionService.addConverterFactory(new StringToNumberConverterFactory());
555555
assertTrue(conversionService.canConvert(String.class, Integer[].class));
556556
}
557-
557+
558558
@Test
559559
public void stringToCollectionCanConvert() throws Exception {
560560
conversionService.addConverter(new StringToCollectionConverter(conversionService));
561561
assertTrue(conversionService.canConvert(String.class, Collection.class));
562562
TypeDescriptor targetType = new TypeDescriptor(getClass().getField("stringToCollection"));
563-
assertFalse(conversionService.canConvert(TypeDescriptor.valueOf(String.class), targetType));
563+
assertFalse(conversionService.canConvert(TypeDescriptor.valueOf(String.class), targetType));
564564
conversionService.addConverterFactory(new StringToNumberConverterFactory());
565-
assertTrue(conversionService.canConvert(TypeDescriptor.valueOf(String.class), targetType));
565+
assertTrue(conversionService.canConvert(TypeDescriptor.valueOf(String.class), targetType));
566566
}
567-
567+
568568
public Collection<Integer> stringToCollection;
569-
569+
570570
@Test
571571
public void testConvertiblePairsInSet() throws Exception {
572572
Set<GenericConverter.ConvertiblePair> set = new HashSet<GenericConverter.ConvertiblePair>();

0 commit comments

Comments
 (0)