diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java index 57e6800ac7..b51694ffa5 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -219,8 +219,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport throws BeansException { StringValueResolver valueResolver = new PlaceholderResolvingStringValueResolver(props); - - this.doProcessProperties(beanFactoryToProcess, valueResolver); + doProcessProperties(beanFactoryToProcess, valueResolver); } /** diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Role.java b/spring-context/src/main/java/org/springframework/context/annotation/Role.java index 3abdca32b1..f8dc81ca6d 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Role.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Role.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2015 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. @@ -28,16 +28,16 @@ import org.springframework.beans.factory.config.BeanDefinition; * Indicates the 'role' hint for a given bean. * *
May be used on any class directly or indirectly annotated with - * {@link org.springframework.stereotype.Component} or on methods annotated with - * {@link Bean}. + * {@link org.springframework.stereotype.Component} or on methods + * annotated with {@link Bean}. * - *
If this annotation is not present on a Component or Bean definition, the - * default value of {@link BeanDefinition#ROLE_APPLICATION} will apply. + *
If this annotation is not present on a Component or Bean definition, + * the default value of {@link BeanDefinition#ROLE_APPLICATION} will apply. * - *
If Role is present on a {@link Configuration @Configuration} class, this - * indicates the role of the configuration class bean definition and does not - * cascade to all @{@code Bean} methods defined within. This behavior is - * different than that of the @{@link Lazy} annotation, for example. + *
If Role is present on a {@link Configuration @Configuration} class, + * this indicates the role of the configuration class bean definition and + * does not cascade to all @{@code Bean} methods defined within. This behavior + * is different than that of the @{@link Lazy} annotation, for example. * * @author Chris Beams * @since 3.1 diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java index 2ca230a1d5..ce8b2c9c85 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java @@ -43,7 +43,7 @@ public class ProxyAsyncConfiguration extends AbstractAsyncConfiguration { public AsyncAnnotationBeanPostProcessor asyncAdvisor() { Assert.notNull(this.enableAsync, "@EnableAsync annotation metadata was not injected"); AsyncAnnotationBeanPostProcessor bpp = new AsyncAnnotationBeanPostProcessor(); - Class extends Annotation> customAsyncAnnotation = enableAsync.getClass("annotation"); + Class extends Annotation> customAsyncAnnotation = this.enableAsync.getClass("annotation"); if (customAsyncAnnotation != AnnotationUtils.getDefaultValue(EnableAsync.class, "annotation")) { bpp.setAsyncAnnotationType(customAsyncAnnotation); } diff --git a/spring-core/src/main/java/org/springframework/util/CollectionUtils.java b/spring-core/src/main/java/org/springframework/util/CollectionUtils.java index 5e74473fa9..dcc3a4858e 100644 --- a/spring-core/src/main/java/org/springframework/util/CollectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/CollectionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2015 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. @@ -42,8 +42,8 @@ import java.util.Set; public abstract class CollectionUtils { /** - * Return {@code true} if the supplied Collection is {@code null} - * or empty. Otherwise, return {@code false}. + * Return {@code true} if the supplied Collection is {@code null} or empty. + * Otherwise, return {@code false}. * @param collection the Collection to check * @return whether the given Collection is empty */ @@ -52,8 +52,8 @@ public abstract class CollectionUtils { } /** - * Return {@code true} if the supplied Map is {@code null} - * or empty. Otherwise, return {@code false}. + * Return {@code true} if the supplied Map is {@code null} or empty. + * Otherwise, return {@code false}. * @param map the Map to check * @return whether the given Map is empty */ @@ -62,13 +62,16 @@ public abstract class CollectionUtils { } /** - * Convert the supplied array into a List. A primitive array gets - * converted into a List of the appropriate wrapper type. - *
A {@code null} source value will be converted to an - * empty List. + * Convert the supplied array into a List. A primitive array gets converted + * into a List of the appropriate wrapper type. + *
NOTE: Generally prefer the standard {@link Arrays#asList} method. + * This {@code arrayToList} method is just meant to deal with an incoming Object + * value that might be an {@code Object[]} or a primitive array at runtime. + *
A {@code null} source value will be converted to an empty List.
* @param source the (potentially primitive) array
* @return the converted List result
* @see ObjectUtils#toObjectArray(Object)
+ * @see Arrays#asList(Object[])
*/
public static List arrayToList(Object source) {
return Arrays.asList(ObjectUtils.toObjectArray(source));
@@ -312,7 +315,7 @@ public abstract class CollectionUtils {
* Enumeration elements must be assignable to the type of the given array. The array
* returned will be a different instance than the array given.
*/
- public static A[] toArray(Enumeration
The xpath may contain the xml namespace prefixes, since namespaces from flight example
+ * are being registered.
* @param msg the error message that will be used in case of test failure
* @param expected the expected value
* @param xpath the xpath to evaluate
@@ -296,9 +293,7 @@ public class CastorMarshallerTests extends AbstractMarshallerTests {
}
/**
- * Creates a instance of {@link CastorObject} for testing.
- *
- * @return a instance of {@link CastorObject}
+ * Create an instance of {@link CastorObject} for testing.
*/
private CastorObject createCastorObject() {
CastorObject castorObject = new CastorObject();
@@ -306,4 +301,5 @@ public class CastorMarshallerTests extends AbstractMarshallerTests {
castorObject.setValue(8);
return castorObject;
}
+
}
diff --git a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
index 8d32deb901..374df68faa 100644
--- a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
+++ b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2014 the original author or authors.
+ * Copyright 2002-2015 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,13 +25,13 @@ import javax.xml.transform.stream.StreamSource;
import org.junit.Ignore;
import org.junit.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
import org.springframework.core.io.ClassPathResource;
import org.springframework.oxm.AbstractUnmarshallerTests;
import org.springframework.oxm.MarshallingException;
import org.springframework.oxm.Unmarshaller;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
@@ -47,15 +47,16 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests {
*/
protected static final String EXTRA_ATTRIBUTES_STRING =
" Supported for annotated handler methods in Servlet environments.
*
* @author Arjen Poutsma
+ * @since 3.0
* @see RequestHeader
* @see ResponseBody
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
- * @since 3.0
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
@@ -49,6 +49,7 @@ public @interface RequestBody {
* Default is {@code true}, leading to an exception thrown in case
* there is no body content. Switch this to {@code false} if you prefer
* {@code null} to be passed when the body content is {@code null}.
+ * @since 3.2
*/
boolean required() default true;
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java
index b56bd79492..a3d786ee33 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java
@@ -52,8 +52,8 @@ import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolv
*
* An {@code @RequestBody} method argument is also validated if it is annotated
* with {@code @javax.validation.Valid}. In case of validation failure,
- * {@link MethodArgumentNotValidException} is raised and results in a 400 response
- * status code if {@link DefaultHandlerExceptionResolver} is configured.
+ * {@link MethodArgumentNotValidException} is raised and results in an HTTP 400
+ * response status code if {@link DefaultHandlerExceptionResolver} is configured.
*
* @author Arjen Poutsma
* @author Rossen Stoyanchev
@@ -141,7 +141,7 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
protected Also see {@link RequestResponseBodyMethodProcessorMockTests}.
*
@@ -74,9 +74,7 @@ public class RequestResponseBodyMethodProcessorTests {
@Before
public void setUp() throws Exception {
-
- Method method = getClass().getMethod("handle",
- List.class, SimpleBean.class, MultiValueMap.class, String.class);
+ Method method = getClass().getMethod("handle", List.class, SimpleBean.class, MultiValueMap.class, String.class);
paramGenericList = new MethodParameter(method, 0);
paramSimpleBean = new MethodParameter(method, 1);
@@ -165,11 +163,8 @@ public class RequestResponseBodyMethodProcessorTests {
assertEquals("foobarbaz", result);
}
- // SPR-9964
-
- @Test
+ @Test // SPR-9964
public void resolveArgumentTypeVariable() throws Exception {
-
Method method = MySimpleParameterizedController.class.getMethod("handleDto", Identifiable.class);
HandlerMethod handlerMethod = new HandlerMethod(new MySimpleParameterizedController(), method);
MethodParameter methodParam = handlerMethod.getMethodParameters()[0];
@@ -188,9 +183,7 @@ public class RequestResponseBodyMethodProcessorTests {
assertEquals("Jad", result.getName());
}
- // SPR-9160
-
- @Test
+ @Test // SPR-9160
public void handleReturnValueSortByQuality() throws Exception {
this.servletRequest.addHeader("Accept", "text/plain; q=0.5, application/json");
@@ -241,22 +234,31 @@ public class RequestResponseBodyMethodProcessorTests {
return null;
}
+
private static abstract class MyParameterizedController