diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ReaderEditorTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ReaderEditorTests.java index 2729922ad9..d4e19b8bae 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ReaderEditorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ReaderEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -34,7 +34,7 @@ public class ReaderEditorTests { @Test(expected = IllegalArgumentException.class) public void testCtorWithNullResourceEditor() throws Exception { - new InputStreamEditor(null); + new ReaderEditor(null); } @Test diff --git a/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java b/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java index a60fbd69db..968530b39d 100644 --- a/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java +++ b/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java @@ -124,7 +124,7 @@ public class DateTimeFormattingTests { @Test public void testBindLocalDateArray() { MutablePropertyValues propertyValues = new MutablePropertyValues(); - propertyValues.add("localDate", new String[]{"10/31/09"}); + propertyValues.add("localDate", new String[] {"10/31/09"}); binder.bind(propertyValues); assertEquals(0, binder.getBindingResult().getErrorCount()); } diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java index fed1e45dec..e4d000e6be 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -185,9 +185,6 @@ final class ObjectToObjectConverter implements ConditionalGenericConverter { method = ClassUtils.getStaticMethod(targetClass, "of", sourceClass); if (method == null) { method = ClassUtils.getStaticMethod(targetClass, "from", sourceClass); - if (method == null) { - return null; - } } } return method; diff --git a/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java b/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java index e1ec8a2732..bc626d6431 100644 --- a/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java +++ b/spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 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. @@ -19,10 +19,10 @@ package org.springframework.core.env; import org.springframework.core.convert.support.ConfigurableConversionService; /** - * Configuration interface to be implemented by most if not all {@link PropertyResolver - * PropertyResolver} types. Provides facilities for accessing and customizing the - * {@link org.springframework.core.convert.ConversionService ConversionService} used when - * converting property values from one type to another. + * Configuration interface to be implemented by most if not all {@link PropertyResolver} + * types. Provides facilities for accessing and customizing the + * {@link org.springframework.core.convert.ConversionService ConversionService} + * used when converting property values from one type to another. * * @author Chris Beams * @since 3.1 @@ -30,7 +30,7 @@ import org.springframework.core.convert.support.ConfigurableConversionService; public interface ConfigurablePropertyResolver extends PropertyResolver { /** - * @return the {@link ConfigurableConversionService} used when performing type + * Return the {@link ConfigurableConversionService} used when performing type * conversions on properties. *
The configurable nature of the returned conversion service allows for * the convenient addition and removal of individual {@code Converter} instances: @@ -46,10 +46,10 @@ public interface ConfigurablePropertyResolver extends PropertyResolver { /** * Set the {@link ConfigurableConversionService} to be used when performing type * conversions on properties. - *
Note: as an alternative to fully replacing the {@code - * ConversionService}, consider adding or removing individual {@code Converter} - * instances by drilling into {@link #getConversionService()} and calling methods - * such as {@code #addConverter}. + *
Note: as an alternative to fully replacing the
+ * {@code ConversionService}, consider adding or removing individual
+ * {@code Converter} instances by drilling into {@link #getConversionService()}
+ * and calling methods such as {@code #addConverter}.
* @see PropertyResolver#getProperty(String, Class)
* @see #getConversionService()
* @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
diff --git a/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java b/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java
index 0d7ba35f25..60acdd3150 100644
--- a/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java
+++ b/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java
@@ -41,8 +41,8 @@ import org.springframework.util.ObjectUtils;
*/
abstract class AnnotationReadingVisitorUtils {
- public static AnnotationAttributes convertClassValues(ClassLoader classLoader, AnnotationAttributes original,
- boolean classValuesAsString) {
+ public static AnnotationAttributes convertClassValues(
+ ClassLoader classLoader, AnnotationAttributes original, boolean classValuesAsString) {
if (original == null) {
return null;
@@ -60,6 +60,7 @@ abstract class AnnotationReadingVisitorUtils {
for (int i = 0; i < values.length; i++) {
values[i] = convertClassValues(classLoader, values[i], classValuesAsString);
}
+ value = values;
}
else if (value instanceof Type) {
value = (classValuesAsString ? ((Type) value).getClassName() :
@@ -67,7 +68,8 @@ abstract class AnnotationReadingVisitorUtils {
}
else if (value instanceof Type[]) {
Type[] array = (Type[]) value;
- Object[] convArray = (classValuesAsString ? new String[array.length] : new Class>[array.length]);
+ Object[] convArray =
+ (classValuesAsString ? new String[array.length] : new Class>[array.length]);
for (int i = 0; i < array.length; i++) {
convArray[i] = (classValuesAsString ? array[i].getClassName() :
classLoader.loadClass(array[i].getClassName()));
@@ -75,11 +77,11 @@ abstract class AnnotationReadingVisitorUtils {
value = convArray;
}
else if (classValuesAsString) {
- if (value instanceof Class) {
+ if (value instanceof Class>) {
value = ((Class>) value).getName();
}
- else if (value instanceof Class[]) {
- Class>[] clazzArray = (Class[]) value;
+ else if (value instanceof Class>[]) {
+ Class>[] clazzArray = (Class>[]) value;
String[] newValue = new String[clazzArray.length];
for (int i = 0; i < clazzArray.length; i++) {
newValue[i] = clazzArray[i].getName();
@@ -94,6 +96,7 @@ abstract class AnnotationReadingVisitorUtils {
result.put(entry.getKey(), ex);
}
}
+
return result;
}
@@ -123,13 +126,12 @@ abstract class AnnotationReadingVisitorUtils {
return null;
}
- // To start with, we populate the results with a copy of all attribute
- // values from the target annotation. A copy is necessary so that we do
- // not inadvertently mutate the state of the metadata passed to this
- // method.
- AnnotationAttributes results = new AnnotationAttributes(attributesList.get(0));
+ // To start with, we populate the result with a copy of all attribute values
+ // from the target annotation. A copy is necessary so that we do not
+ // inadvertently mutate the state of the metadata passed to this method.
+ AnnotationAttributes result = new AnnotationAttributes(attributesList.get(0));
- Set