diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java index bdad578fc5..df3b730d11 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java @@ -27,8 +27,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter; import org.springframework.util.ObjectUtils; /** - * Converts an Array to another Array. First adapts the source array to a List, then - * delegates to {@link CollectionToArrayConverter} to perform the target array conversion. + * Converts an array to another array. First adapts the source array to a List, + * then delegates to {@link CollectionToArrayConverter} to perform the target + * array conversion. * * @author Keith Donald * @author Phillip Webb diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToObjectConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToObjectConverter.java index 78d2f93548..ef92f0bd12 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToObjectConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToObjectConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,8 @@ import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.ConditionalGenericConverter; /** - * Converts an Array to an Object by returning the first array element after converting it to the desired targetType. + * Converts an array to an Object by returning the first array element + * after converting it to the desired target type. * * @author Keith Donald * @since 3.0 @@ -34,10 +35,12 @@ final class ArrayToObjectConverter implements ConditionalGenericConverter { private final ConversionService conversionService; + public ArrayToObjectConverter(ConversionService conversionService) { this.conversionService = conversionService; } + @Override public Set getConvertibleTypes() { return Collections.singleton(new ConvertiblePair(Object[].class, Object.class)); diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToStringConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToStringConverter.java index ff9db8ef3f..80f986a6e4 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToStringConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToStringConverter.java @@ -26,9 +26,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter; import org.springframework.util.ObjectUtils; /** - * Converts an Array to a comma-delimited String. - * This implementation first adapts the source Array to a List, - * then delegates to {@link CollectionToStringConverter} to perform the target String conversion. + * Converts an array to a comma-delimited String. First adapts the source array + * to a List, then delegates to {@link CollectionToStringConverter} to perform + * the target String conversion. * * @author Keith Donald * @since 3.0 diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToArrayConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToArrayConverter.java index bf64daf892..1531926a9e 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToArrayConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToArrayConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.ConditionalGenericConverter; /** - * Converts an Object to a single-element Array containing the Object. - * Will convert the Object to the target Array's component type if necessary. + * Converts an Object to a single-element array containing the Object. + * Will convert the Object to the target array's component type if necessary. * * @author Keith Donald * @since 3.0 @@ -35,10 +35,12 @@ final class ObjectToArrayConverter implements ConditionalGenericConverter { private final ConversionService conversionService; + public ObjectToArrayConverter(ConversionService conversionService) { this.conversionService = conversionService; } + @Override public Set getConvertibleTypes() { return Collections.singleton(new ConvertiblePair(Object.class, Object[].class)); diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java b/spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java index 7fec5eb48f..923239b919 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java @@ -20,12 +20,12 @@ import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.ConverterFactory; /** - * Converts from a String to a java.lang.Enum by calling {@link Enum#valueOf(Class, String)}. + * Converts from a String to a {@link java.lang.Enum} by calling {@link Enum#valueOf(Class, String)}. * * @author Keith Donald * @since 3.0 */ -@SuppressWarnings({ "unchecked", "rawtypes" }) +@SuppressWarnings({"unchecked", "rawtypes"}) final class StringToEnumConverterFactory implements ConverterFactory { @Override @@ -35,7 +35,8 @@ final class StringToEnumConverterFactory implements ConverterFactory