While this method can take any {@code Object} as a parameter, it - * is recommended to use the following types: + * Add an HTTP 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: *
If the internal value representation is a String, this method will try
@@ -1264,7 +1273,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
public String changeSessionId() {
Assert.isTrue(this.session != null, "The request does not have a session");
if (this.session instanceof MockHttpSession) {
- return ((MockHttpSession) session).changeSessionId();
+ return ((MockHttpSession) this.session).changeSessionId();
}
return this.session.getId();
}
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 5ca558586a..7552e9d9c3 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
@@ -101,7 +101,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
new BufferedReader(new StringReader(""));
/**
- * Date formats as specified in the HTTP RFC
+ * Date formats as specified in the HTTP RFC.
* @see Section 7.1.1.1 of RFC 7231
*/
private static final String[] DATE_FORMATS = new String[] {
@@ -551,7 +551,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
/**
- * Adds all provided parameters without replacing any
+ * Add all provided parameters without replacing any
* existing values. To replace existing values, use
* {@link #setParameters(java.util.Map)}.
*/
@@ -581,7 +581,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
/**
- * Removes all existing parameters.
+ * Remove all existing parameters.
*/
public void removeAllParameters() {
this.parameters.clear();
@@ -746,8 +746,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
/**
* Set the list of preferred locales, in descending order, effectively replacing
* any existing locales.
- * @see #addPreferredLocale
* @since 3.2
+ * @see #addPreferredLocale
*/
public void setPreferredLocales(List While this method can take any {@code Object} as a parameter, it
- * is recommended to use the following types:
+ * Add an HTTP 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:
* If the internal value representation is a String, this method will try
@@ -1232,7 +1241,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
public String changeSessionId() {
Assert.isTrue(this.session != null, "The request does not have a session");
if (this.session instanceof MockHttpSession) {
- return ((MockHttpSession) session).changeSessionId();
+ return ((MockHttpSession) this.session).changeSessionId();
}
return this.session.getId();
}
*