Polishing

This commit is contained in:
Juergen Hoeller
2017-07-20 00:14:56 +02:00
parent 378c72e9b6
commit 6d6d772f31
5 changed files with 8 additions and 16 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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.
*
* <p>Not intended to be used directly. See
* {@link org.springframework.web.client.AsyncRestTemplate}.

View File

@@ -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());

View File

@@ -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)