diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
index ad0fdde117..0e08f14ec4 100644
--- a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
+++ b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
@@ -876,16 +876,18 @@ public class MockHttpServletRequest implements HttpServletRequest {
/**
* Add a header entry for the given name.
- *
While this method can take any {@code Object} as a parameter,
- * it is recommended to use the following types:
+ *
While this method can take any {@code Object} as a parameter, it
+ * is recommended to use the following types:
*
- * - String or any Object to be converted using {@code toString}, see {@link #getHeader}
- * - String, Number or Date for date headers, see {@link #getDateHeader}
- * - String or Number for integer headers, see {@link #getIntHeader}
- * - {@code String[]} and {@code Collection} for multiple values, see {@link #getHeaders}
+ * - String or any Object to be converted using {@code toString()}; see {@link #getHeader}.
+ * - String, Number, or Date for date headers; see {@link #getDateHeader}.
+ * - String or Number for integer headers; see {@link #getIntHeader}.
+ * - {@code String[]} or {@code Collection} for multiple values; see {@link #getHeaders}.
*
* @see #getHeaderNames
* @see #getHeaders
+ * @see #getHeader
+ * @see #getDateHeader
*/
public void addHeader(String name, Object value) {
if (CONTENT_TYPE_HEADER.equalsIgnoreCase(name)) {
@@ -919,9 +921,9 @@ public class MockHttpServletRequest implements HttpServletRequest {
* If the internal value representation is a String, this method will try
* to parse it as a date using the supported date formats:
*
- * - "EEE, dd MMM yyyy HH:mm:ss zzz"
- * - "EEE, dd-MMM-yy HH:mm:ss zzz"
- * - "EEE MMM dd HH:mm:ss yyyy"
+ * - "EEE, dd MMM yyyy HH:mm:ss zzz"
+ * - "EEE, dd-MMM-yy HH:mm:ss zzz"
+ * - "EEE MMM dd HH:mm:ss yyyy"
*
* @param name the header name
* @see Section 7.1.1.1 of RFC 7231
diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java
index 0071cf05b9..ff90ffd7c7 100644
--- a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java
+++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java
@@ -134,7 +134,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
"EEE MMM dd HH:mm:ss yyyy"
};
- private static TimeZone GMT = TimeZone.getTimeZone("GMT");
+ private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
+
private boolean active = true;
@@ -696,7 +697,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
/**
- * Returns the first preferred {@linkplain Locale locale} configured
+ * Return the first preferred {@linkplain Locale locale} configured
* in this mock request.
* If no locales have been explicitly configured, the default,
* preferred {@link Locale} for the server mocked by this
@@ -714,7 +715,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
/**
- * Returns an {@linkplain Enumeration enumeration} of the preferred
+ * Return an {@linkplain Enumeration enumeration} of the preferred
* {@linkplain Locale locales} configured in this mock request.
*
If no locales have been explicitly configured, the default,
* preferred {@link Locale} for the server mocked by this
@@ -743,7 +744,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
/**
- * Returns {@code true} if the {@link #setSecure secure} flag has been set
+ * Return {@code true} if the {@link #setSecure secure} flag has been set
* to {@code true} or if the {@link #getScheme scheme} is {@code https}.
* @see javax.servlet.ServletRequest#isSecure()
*/
@@ -875,16 +876,18 @@ public class MockHttpServletRequest implements HttpServletRequest {
/**
* Add a header entry for the given name.
- *
While this method can take any {@code Object} as a parameter,
- * it is recommended to use the following types:
+ *
While this method can take any {@code Object} as a parameter, it
+ * is recommended to use the following types:
*
- * - String or any Object to be converted using {@code toString}, see {@link #getHeader}
- * - String, Number or Date for date headers, see {@link #getDateHeader}
- * - String or Number for integer headers, see {@link #getIntHeader}
- * - {@code String[]} and {@code Collection} for multiple values, see {@link #getHeaders}
+ * - String or any Object to be converted using {@code toString()}; see {@link #getHeader}.
+ * - String, Number, or Date for date headers; see {@link #getDateHeader}.
+ * - String or Number for integer headers; see {@link #getIntHeader}.
+ * - {@code String[]} or {@code Collection} for multiple values; see {@link #getHeaders}.
*
* @see #getHeaderNames
* @see #getHeaders
+ * @see #getHeader
+ * @see #getDateHeader
*/
public void addHeader(String name, Object value) {
if (CONTENT_TYPE_HEADER.equalsIgnoreCase(name)) {
@@ -918,9 +921,9 @@ public class MockHttpServletRequest implements HttpServletRequest {
* If the internal value representation is a String, this method will try
* to parse it as a date using the supported date formats:
*
- * - "EEE, dd MMM yyyy HH:mm:ss zzz"
- * - "EEE, dd-MMM-yy HH:mm:ss zzz"
- * - "EEE MMM dd HH:mm:ss yyyy"
+ * - "EEE, dd MMM yyyy HH:mm:ss zzz"
+ * - "EEE, dd-MMM-yy HH:mm:ss zzz"
+ * - "EEE MMM dd HH:mm:ss yyyy"
*
* @param name the header name
* @see Section 7.1.1.1 of RFC 7231