Skip to content

Commit 60afa5e

Browse files
committed
Polish trailing whitespace
1 parent ea8b132 commit 60afa5e

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Set<ConvertiblePair> getConvertibleTypes() {
5151
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
5252
return canConvertKey(sourceType, targetType) && canConvertValue(sourceType, targetType);
5353
}
54-
54+
5555
@SuppressWarnings("unchecked")
5656
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
5757
if (source == null) {
@@ -75,19 +75,19 @@ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor t
7575
}
7676
return (copyRequired ? targetMap : sourceMap);
7777
}
78-
78+
7979
// internal helpers
8080

8181
private boolean canConvertKey(TypeDescriptor sourceType, TypeDescriptor targetType) {
8282
return ConversionUtils.canConvertElements(sourceType.getMapKeyTypeDescriptor(),
8383
targetType.getMapKeyTypeDescriptor(), this.conversionService);
8484
}
85-
85+
8686
private boolean canConvertValue(TypeDescriptor sourceType, TypeDescriptor targetType) {
8787
return ConversionUtils.canConvertElements(sourceType.getMapValueTypeDescriptor(),
8888
targetType.getMapValueTypeDescriptor(), this.conversionService);
8989
}
90-
90+
9191
private Object convertKey(Object sourceKey, TypeDescriptor sourceType, TypeDescriptor targetType) {
9292
if (targetType == null) {
9393
return sourceKey;

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void scalarMap() throws Exception {
5555
}
5656
conversionService.addConverterFactory(new StringToNumberConverterFactory());
5757
assertTrue(conversionService.canConvert(sourceType, targetType));
58-
@SuppressWarnings("unchecked")
58+
@SuppressWarnings("unchecked")
5959
Map<Integer, Integer> result = (Map<Integer, Integer>) conversionService.convert(map, sourceType, targetType);
6060
assertFalse(map.equals(result));
6161
assertEquals((Integer) 9, result.get(1));
@@ -79,7 +79,7 @@ public void scalarMapNotGenericSourceField() throws Exception {
7979
map.put("1", "9");
8080
map.put("2", "37");
8181
TypeDescriptor sourceType = new TypeDescriptor(getClass().getField("notGenericMapSource"));
82-
TypeDescriptor targetType = new TypeDescriptor(getClass().getField("scalarMapTarget"));
82+
TypeDescriptor targetType = new TypeDescriptor(getClass().getField("scalarMapTarget"));
8383
assertTrue(conversionService.canConvert(sourceType, targetType));
8484
try {
8585
conversionService.convert(map, sourceType, targetType);
@@ -88,15 +88,15 @@ public void scalarMapNotGenericSourceField() throws Exception {
8888
}
8989
conversionService.addConverterFactory(new StringToNumberConverterFactory());
9090
assertTrue(conversionService.canConvert(sourceType, targetType));
91-
@SuppressWarnings("unchecked")
91+
@SuppressWarnings("unchecked")
9292
Map<Integer, Integer> result = (Map<Integer, Integer>) conversionService.convert(map, sourceType, targetType);
9393
assertFalse(map.equals(result));
9494
assertEquals((Integer) 9, result.get(1));
95-
assertEquals((Integer) 37, result.get(2));
95+
assertEquals((Integer) 37, result.get(2));
9696
}
97-
97+
9898
public Map notGenericMapSource;
99-
99+
100100
@Test
101101
public void collectionMap() throws Exception {
102102
Map<String, List<String>> map = new HashMap<String, List<String>>();
@@ -109,11 +109,11 @@ public void collectionMap() throws Exception {
109109
conversionService.convert(map, sourceType, targetType);
110110
} catch (ConversionFailedException e) {
111111
assertTrue(e.getCause() instanceof ConverterNotFoundException);
112-
}
112+
}
113113
conversionService.addConverter(new CollectionToCollectionConverter(conversionService));
114114
conversionService.addConverterFactory(new StringToNumberConverterFactory());
115115
assertTrue(conversionService.canConvert(sourceType, targetType));
116-
@SuppressWarnings("unchecked")
116+
@SuppressWarnings("unchecked")
117117
Map<Integer, List<Integer>> result = (Map<Integer, List<Integer>>) conversionService.convert(map, sourceType, targetType);
118118
assertFalse(map.equals(result));
119119
assertEquals(Arrays.asList(9, 12), result.get(1));
@@ -134,12 +134,12 @@ public void collectionMapSourceTarget() throws Exception {
134134
conversionService.convert(map, sourceType, targetType);
135135
fail("Should have failed");
136136
} catch (ConverterNotFoundException e) {
137-
137+
138138
}
139139
conversionService.addConverter(new CollectionToCollectionConverter(conversionService));
140140
conversionService.addConverterFactory(new StringToNumberConverterFactory());
141141
assertTrue(conversionService.canConvert(sourceType, targetType));
142-
@SuppressWarnings("unchecked")
142+
@SuppressWarnings("unchecked")
143143
Map<Integer, List<Integer>> result = (Map<Integer, List<Integer>>) conversionService.convert(map, sourceType, targetType);
144144
assertFalse(map.equals(result));
145145
assertEquals(Arrays.asList(9, 12), result.get(1));
@@ -167,7 +167,7 @@ public void collectionMapNotGenericTargetCollectionToObjectInteraction() throws
167167
assertTrue(conversionService.canConvert(Map.class, Map.class));
168168
assertSame(map, conversionService.convert(map, Map.class));
169169
}
170-
170+
171171
@Test
172172
public void emptyMap() throws Exception {
173173
Map<String, String> map = new HashMap<String, String>();

0 commit comments

Comments
 (0)