Skip to content

Commit 7635e7b

Browse files
committed
Polishing
Issue: SPR-12483
1 parent fef4cd0 commit 7635e7b

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
import org.springframework.util.ObjectUtils;
2828

2929
/**
30-
* Converts an Array to another Array. First adapts the source array to a List, then
31-
* delegates to {@link CollectionToArrayConverter} to perform the target array conversion.
30+
* Converts an array to another array. First adapts the source array to a List,
31+
* then delegates to {@link CollectionToArrayConverter} to perform the target
32+
* array conversion.
3233
*
3334
* @author Keith Donald
3435
* @author Phillip Webb

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,8 @@
2525
import org.springframework.core.convert.converter.ConditionalGenericConverter;
2626

2727
/**
28-
* Converts an Array to an Object by returning the first array element after converting it to the desired targetType.
28+
* Converts an array to an Object by returning the first array element
29+
* after converting it to the desired target type.
2930
*
3031
* @author Keith Donald
3132
* @since 3.0
@@ -34,10 +35,12 @@ final class ArrayToObjectConverter implements ConditionalGenericConverter {
3435

3536
private final ConversionService conversionService;
3637

38+
3739
public ArrayToObjectConverter(ConversionService conversionService) {
3840
this.conversionService = conversionService;
3941
}
4042

43+
4144
@Override
4245
public Set<ConvertiblePair> getConvertibleTypes() {
4346
return Collections.singleton(new ConvertiblePair(Object[].class, Object.class));

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import org.springframework.util.ObjectUtils;
2727

2828
/**
29-
* Converts an Array to a comma-delimited String.
30-
* This implementation first adapts the source Array to a List,
31-
* then delegates to {@link CollectionToStringConverter} to perform the target String conversion.
29+
* Converts an array to a comma-delimited String. First adapts the source array
30+
* to a List, then delegates to {@link CollectionToStringConverter} to perform
31+
* the target String conversion.
3232
*
3333
* @author Keith Donald
3434
* @since 3.0

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
2525
import org.springframework.core.convert.converter.ConditionalGenericConverter;
2626

2727
/**
28-
* Converts an Object to a single-element Array containing the Object.
29-
* Will convert the Object to the target Array's component type if necessary.
28+
* Converts an Object to a single-element array containing the Object.
29+
* Will convert the Object to the target array's component type if necessary.
3030
*
3131
* @author Keith Donald
3232
* @since 3.0
@@ -35,10 +35,12 @@ final class ObjectToArrayConverter implements ConditionalGenericConverter {
3535

3636
private final ConversionService conversionService;
3737

38+
3839
public ObjectToArrayConverter(ConversionService conversionService) {
3940
this.conversionService = conversionService;
4041
}
4142

43+
4244
@Override
4345
public Set<ConvertiblePair> getConvertibleTypes() {
4446
return Collections.singleton(new ConvertiblePair(Object.class, Object[].class));

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
import org.springframework.core.convert.converter.ConverterFactory;
2121

2222
/**
23-
* Converts from a String to a java.lang.Enum by calling {@link Enum#valueOf(Class, String)}.
23+
* Converts from a String to a {@link java.lang.Enum} by calling {@link Enum#valueOf(Class, String)}.
2424
*
2525
* @author Keith Donald
2626
* @since 3.0
2727
*/
28-
@SuppressWarnings({ "unchecked", "rawtypes" })
28+
@SuppressWarnings({"unchecked", "rawtypes"})
2929
final class StringToEnumConverterFactory implements ConverterFactory<String, Enum> {
3030

3131
@Override
@@ -35,7 +35,8 @@ public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) {
3535
enumType = enumType.getSuperclass();
3636
}
3737
if (enumType == null) {
38-
throw new IllegalArgumentException("The target type " + targetType.getName() + " does not refer to an enum");
38+
throw new IllegalArgumentException(
39+
"The target type " + targetType.getName() + " does not refer to an enum");
3940
}
4041
return new StringToEnum(enumType);
4142
}

0 commit comments

Comments
 (0)