diff --git a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java
index c39f5c56754..83dbff299ab 100644
--- a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java
+++ b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java
@@ -90,7 +90,7 @@ public abstract class ScopedProxyUtils {
}
/**
- * Generates the bean name that is used within the scoped proxy to reference the target bean.
+ * Generate the bean name that is used within the scoped proxy to reference the target bean.
* @param originalBeanName the original name of bean
* @return the generated bean to be used to reference the target bean
*/
diff --git a/spring-context/src/test/java/org/springframework/aop/scope/ScopedProxyTests.java b/spring-context/src/test/java/org/springframework/aop/scope/ScopedProxyTests.java
index 179d061ecc6..05e6f604f8e 100644
--- a/spring-context/src/test/java/org/springframework/aop/scope/ScopedProxyTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/scope/ScopedProxyTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2017 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.
@@ -49,8 +49,8 @@ public class ScopedProxyTests {
private static final ClassPathResource OVERRIDE_CONTEXT = new ClassPathResource(CLASSNAME + "-override.xml", CLASS);
private static final ClassPathResource TESTBEAN_CONTEXT = new ClassPathResource(CLASSNAME + "-testbean.xml", CLASS);
- /* SPR-2108 */
- @Test
+
+ @Test // SPR-2108
public void testProxyAssignable() throws Exception {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(bf).loadBeanDefinitions(MAP_CONTEXT);
diff --git a/spring-context/src/test/resources/org/springframework/aop/scope/ScopedProxyTests-override.xml b/spring-context/src/test/resources/org/springframework/aop/scope/ScopedProxyTests-override.xml
index 768e429c2f6..41fcd3a1b04 100644
--- a/spring-context/src/test/resources/org/springframework/aop/scope/ScopedProxyTests-override.xml
+++ b/spring-context/src/test/resources/org/springframework/aop/scope/ScopedProxyTests-override.xml
@@ -6,16 +6,16 @@
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
Note: while relative redirects are more efficient they + *
Note: While relative redirects are more efficient they * may not work with reverse proxies under some configurations. * * @author Rob Winch * @author Rossen Stoyanchev - * @since 5.0 + * @since 4.3.10 */ public class RelativeRedirectFilter extends OncePerRequestFilter { @@ -50,8 +50,8 @@ public class RelativeRedirectFilter extends OncePerRequestFilter { * @param status the 3xx redirect status to use */ public void setRedirectStatus(HttpStatus status) { - Assert.notNull(status, "HttpStatus is required"); - Assert.isTrue(status.is3xxRedirection(), "Not a redirect status: " + status); + Assert.notNull(status, "Property 'redirectStatus' is required"); + Assert.isTrue(status.is3xxRedirection(), "Not a redirect status code"); this.redirectStatus = status; } diff --git a/spring-web/src/main/java/org/springframework/web/filter/RelativeRedirectResponseWrapper.java b/spring-web/src/main/java/org/springframework/web/filter/RelativeRedirectResponseWrapper.java index 744f8d63b1a..af95f1c4188 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/RelativeRedirectResponseWrapper.java +++ b/spring-web/src/main/java/org/springframework/web/filter/RelativeRedirectResponseWrapper.java @@ -29,7 +29,7 @@ import org.springframework.util.Assert; * {@link RelativeRedirectFilter} also shared with {@link ForwardedHeaderFilter}. * * @author Rossen Stoyanchev - * @since 5.0 + * @since 4.3.10 */ class RelativeRedirectResponseWrapper extends HttpServletResponseWrapper { @@ -38,7 +38,7 @@ class RelativeRedirectResponseWrapper extends HttpServletResponseWrapper { private RelativeRedirectResponseWrapper(HttpServletResponse response, HttpStatus redirectStatus) { super(response); - Assert.notNull(redirectStatus, "'redirectStatus' is required."); + Assert.notNull(redirectStatus, "'redirectStatus' is required"); this.redirectStatus = redirectStatus; } @@ -53,8 +53,7 @@ class RelativeRedirectResponseWrapper extends HttpServletResponseWrapper { public static HttpServletResponse wrapIfNecessary(HttpServletResponse response, HttpStatus redirectStatus) { - return hasWrapper(response) ? response : - new RelativeRedirectResponseWrapper(response, redirectStatus); + return (hasWrapper(response) ? response : new RelativeRedirectResponseWrapper(response, redirectStatus)); } private static boolean hasWrapper(ServletResponse response) { diff --git a/spring-web/src/test/java/org/springframework/web/filter/ForwardedHeaderFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/ForwardedHeaderFilterTests.java index a93fe592245..4e20defb0e6 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/ForwardedHeaderFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/ForwardedHeaderFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -32,10 +32,7 @@ import org.springframework.mock.web.test.MockFilterChain; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; /** * Unit tests for {@link ForwardedHeaderFilter}. @@ -61,7 +58,7 @@ public class ForwardedHeaderFilterTests { @Before @SuppressWarnings("serial") - public void setUp() throws Exception { + public void setup() throws Exception { this.request = new MockHttpServletRequest(); this.request.setScheme("http"); this.request.setServerName("localhost"); diff --git a/spring-web/src/test/java/org/springframework/web/filter/RelativeRedirectFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/RelativeRedirectFilterTests.java index 5eabda751aa..c246d6157ca 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/RelativeRedirectFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/RelativeRedirectFilterTests.java @@ -32,11 +32,11 @@ import org.springframework.mock.web.test.MockFilterChain; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; +import static org.junit.Assert.*; /** * Unit tests for {@link RelativeRedirectFilter}. + * * @author Rob Winch */ @RunWith(MockitoJUnitRunner.class) @@ -110,4 +110,5 @@ public class RelativeRedirectFilterTests { HttpServletResponse wrappedResponse = (HttpServletResponse) chain.getResponse(); wrappedResponse.sendRedirect(location); } -} \ No newline at end of file + +} diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java index a65908371be..def02a1b59a 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java @@ -113,7 +113,7 @@ public class RedirectView extends AbstractUrlBasedView { * {@link HttpStatus#PERMANENT_REDIRECT}. */ public void setStatusCode(HttpStatus statusCode) { - Assert.isTrue(statusCode.is3xxRedirection(), "Must be a redirection (3xx status code)"); + Assert.isTrue(statusCode.is3xxRedirection(), "Not a redirect status code"); this.statusCode = statusCode; } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/RedirectViewControllerRegistration.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/RedirectViewControllerRegistration.java index 612b7938f58..e6713cf2c57 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/RedirectViewControllerRegistration.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/RedirectViewControllerRegistration.java @@ -54,7 +54,7 @@ public class RedirectViewControllerRegistration { * will select {@code HttpStatus.MOVED_TEMPORARILY (302)} by default. */ public RedirectViewControllerRegistration setStatusCode(HttpStatus statusCode) { - Assert.isTrue(statusCode.is3xxRedirection(), "Not a redirect status code."); + Assert.isTrue(statusCode.is3xxRedirection(), "Not a redirect status code"); this.redirectView.setStatusCode(statusCode); return this; }