From 71e0a506b94eaeea018aa34334a366c4578d979f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 1 Dec 2011 15:12:26 +0000 Subject: [PATCH] polishing --- .../convert/support/CollectionToCollectionConverter.java | 8 +++++--- .../core/convert/support/MapToMapConverter.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/support/CollectionToCollectionConverter.java b/org.springframework.core/src/main/java/org/springframework/core/convert/support/CollectionToCollectionConverter.java index 0046d2b2bb..74eb760379 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/support/CollectionToCollectionConverter.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/support/CollectionToCollectionConverter.java @@ -49,7 +49,8 @@ final class CollectionToCollectionConverter implements ConditionalGenericConvert } public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) { - return ConversionUtils.canConvertElements(sourceType.getElementTypeDescriptor(), targetType.getElementTypeDescriptor(), conversionService); + return ConversionUtils.canConvertElements( + sourceType.getElementTypeDescriptor(), targetType.getElementTypeDescriptor(), this.conversionService); } @SuppressWarnings("unchecked") @@ -67,14 +68,15 @@ final class CollectionToCollectionConverter implements ConditionalGenericConvert } else { for (Object sourceElement : sourceCollection) { - Object targetElement = this.conversionService.convert(sourceElement, sourceType.elementTypeDescriptor(sourceElement), targetType.getElementTypeDescriptor()); + Object targetElement = this.conversionService.convert(sourceElement, + sourceType.elementTypeDescriptor(sourceElement), targetType.getElementTypeDescriptor()); target.add(targetElement); if (sourceElement != targetElement) { copyRequired = true; } } } - return copyRequired ? target : source; + return (copyRequired ? target : source); } } diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java b/org.springframework.core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java index f7b5c28ed4..6652fc8433 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/support/MapToMapConverter.java @@ -70,17 +70,19 @@ final class MapToMapConverter implements ConditionalGenericConverter { copyRequired = true; } } - return copyRequired ? targetMap : sourceMap; + return (copyRequired ? targetMap : sourceMap); } // internal helpers private boolean canConvertKey(TypeDescriptor sourceType, TypeDescriptor targetType) { - return ConversionUtils.canConvertElements(sourceType.getMapKeyTypeDescriptor(), targetType.getMapKeyTypeDescriptor(), this.conversionService); + 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); + return ConversionUtils.canConvertElements(sourceType.getMapValueTypeDescriptor(), + targetType.getMapValueTypeDescriptor(), this.conversionService); } private Object convertKey(Object sourceKey, TypeDescriptor sourceType, TypeDescriptor targetType) {