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
@@ -1164,7 +1173,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 c1b9934515..733a258808 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
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -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[] {
@@ -510,7 +510,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)}.
*/
@@ -540,7 +540,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
/**
- * Removes all existing parameters.
+ * Remove all existing parameters.
*/
public void removeAllParameters() {
this.parameters.clear();
@@ -702,8 +702,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
@@ -1164,7 +1173,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();
}
*