From 60afa5ead4082cd7fa54c2388890af800bbad671 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 12 Oct 2012 13:09:53 -0700 Subject: [PATCH] Polish trailing whitespace --- .../convert/support/MapToMapConverter.java | 8 +++---- .../support/MapToMapConverterTests.java | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java index e8923e3ec6e..0e597214b5e 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java @@ -51,7 +51,7 @@ final class MapToMapConverter implements ConditionalGenericConverter { public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) { return canConvertKey(sourceType, targetType) && canConvertValue(sourceType, targetType); } - + @SuppressWarnings("unchecked") public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { @@ -75,19 +75,19 @@ final class MapToMapConverter implements ConditionalGenericConverter { } return (copyRequired ? targetMap : sourceMap); } - + // internal helpers private boolean canConvertKey(TypeDescriptor sourceType, TypeDescriptor targetType) { return ConversionUtils.canConvertElements(sourceType.getMapKeyTypeDescriptor(), targetType.getMapKeyTypeDescriptor(), this.conversionService); } - + private boolean canConvertValue(TypeDescriptor sourceType, TypeDescriptor targetType) { return ConversionUtils.canConvertElements(sourceType.getMapValueTypeDescriptor(), targetType.getMapValueTypeDescriptor(), this.conversionService); } - + private Object convertKey(Object sourceKey, TypeDescriptor sourceType, TypeDescriptor targetType) { if (targetType == null) { return sourceKey; diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java index afb525cb5bb..a2d51cd51e9 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java @@ -55,7 +55,7 @@ public class MapToMapConverterTests { } conversionService.addConverterFactory(new StringToNumberConverterFactory()); assertTrue(conversionService.canConvert(sourceType, targetType)); - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Map result = (Map) conversionService.convert(map, sourceType, targetType); assertFalse(map.equals(result)); assertEquals((Integer) 9, result.get(1)); @@ -79,7 +79,7 @@ public class MapToMapConverterTests { map.put("1", "9"); map.put("2", "37"); TypeDescriptor sourceType = new TypeDescriptor(getClass().getField("notGenericMapSource")); - TypeDescriptor targetType = new TypeDescriptor(getClass().getField("scalarMapTarget")); + TypeDescriptor targetType = new TypeDescriptor(getClass().getField("scalarMapTarget")); assertTrue(conversionService.canConvert(sourceType, targetType)); try { conversionService.convert(map, sourceType, targetType); @@ -88,15 +88,15 @@ public class MapToMapConverterTests { } conversionService.addConverterFactory(new StringToNumberConverterFactory()); assertTrue(conversionService.canConvert(sourceType, targetType)); - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Map result = (Map) conversionService.convert(map, sourceType, targetType); assertFalse(map.equals(result)); assertEquals((Integer) 9, result.get(1)); - assertEquals((Integer) 37, result.get(2)); + assertEquals((Integer) 37, result.get(2)); } - + public Map notGenericMapSource; - + @Test public void collectionMap() throws Exception { Map> map = new HashMap>(); @@ -109,11 +109,11 @@ public class MapToMapConverterTests { conversionService.convert(map, sourceType, targetType); } catch (ConversionFailedException e) { assertTrue(e.getCause() instanceof ConverterNotFoundException); - } + } conversionService.addConverter(new CollectionToCollectionConverter(conversionService)); conversionService.addConverterFactory(new StringToNumberConverterFactory()); assertTrue(conversionService.canConvert(sourceType, targetType)); - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Map> result = (Map>) conversionService.convert(map, sourceType, targetType); assertFalse(map.equals(result)); assertEquals(Arrays.asList(9, 12), result.get(1)); @@ -134,12 +134,12 @@ public class MapToMapConverterTests { conversionService.convert(map, sourceType, targetType); fail("Should have failed"); } catch (ConverterNotFoundException e) { - + } conversionService.addConverter(new CollectionToCollectionConverter(conversionService)); conversionService.addConverterFactory(new StringToNumberConverterFactory()); assertTrue(conversionService.canConvert(sourceType, targetType)); - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Map> result = (Map>) conversionService.convert(map, sourceType, targetType); assertFalse(map.equals(result)); assertEquals(Arrays.asList(9, 12), result.get(1)); @@ -167,7 +167,7 @@ public class MapToMapConverterTests { assertTrue(conversionService.canConvert(Map.class, Map.class)); assertSame(map, conversionService.convert(map, Map.class)); } - + @Test public void emptyMap() throws Exception { Map map = new HashMap();