diff --git a/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java index 39a08aa5901..2afacfe91ba 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java @@ -24,7 +24,6 @@ import org.springframework.core.Ordered; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; -import org.springframework.util.StringUtils; /** * Implementation of {@link AspectInstanceFactory} that locates the aspect from the diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java index 9fc040c7287..20f5e91c6d3 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java @@ -81,12 +81,10 @@ public abstract class AbstractJdbcInsert { private volatile boolean compiled = false; /** The generated string used for insert statement */ - @Nullable - private String insertString; + private String insertString = ""; /** The SQL type information for the insert columns */ - @Nullable - private int[] insertTypes; + private int[] insertTypes = new int[0]; /** @@ -224,7 +222,6 @@ public abstract class AbstractJdbcInsert { /** * Get the insert string to be used. */ - @Nullable public String getInsertString() { return this.insertString; } @@ -232,7 +229,6 @@ public abstract class AbstractJdbcInsert { /** * Get the array of {@link java.sql.Types} to be used for insert. */ - @Nullable public int[] getInsertTypes() { return this.insertTypes; } diff --git a/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java b/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java index 0683ad1b1d2..ab850ec9784 100644 --- a/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java +++ b/spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java @@ -29,7 +29,8 @@ import org.springframework.util.Assert; /** * Base class for {@link org.springframework.web.client.AsyncRestTemplate} * and other HTTP accessing gateway helpers, defining common properties - * such as the {@link org.springframework.http.client.AsyncClientHttpRequestFactory} to operate on. + * such as the {@link org.springframework.http.client.AsyncClientHttpRequestFactory} + * to operate on. * *

Not intended to be used directly. See * {@link org.springframework.web.client.AsyncRestTemplate}. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/LiveBeansViewServlet.java b/spring-web/src/main/java/org/springframework/web/context/support/LiveBeansViewServlet.java index 90623795eef..193a3757c6d 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/LiveBeansViewServlet.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/LiveBeansViewServlet.java @@ -57,7 +57,7 @@ public class LiveBeansViewServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Assert.state(this.liveBeansView != null, "No LiveBeanViews available"); + Assert.state(this.liveBeansView != null, "No LiveBeansView available"); String content = this.liveBeansView.getSnapshotAsJson(); response.setContentType("application/json"); response.setContentLength(content.length()); 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 c246d6157ca..46b807346c7 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 @@ -20,11 +20,8 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import org.junit.Test; -import org.junit.runner.RunWith; import org.mockito.InOrder; -import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; @@ -38,14 +35,13 @@ import static org.junit.Assert.*; * Unit tests for {@link RelativeRedirectFilter}. * * @author Rob Winch + * @author Juergen Hoeller */ -@RunWith(MockitoJUnitRunner.class) public class RelativeRedirectFilterTests { - @Mock - HttpServletResponse response; + private RelativeRedirectFilter filter = new RelativeRedirectFilter(); - RelativeRedirectFilter filter = new RelativeRedirectFilter(); + private HttpServletResponse response = Mockito.mock(HttpServletResponse.class); @Test(expected = IllegalArgumentException.class)