Polishing

This commit is contained in:
Juergen Hoeller
2018-02-16 21:02:00 +01:00
parent 6d11b40353
commit 87abdb92da
4 changed files with 23 additions and 38 deletions

View File

@@ -73,7 +73,6 @@ public class MockHttpSession implements HttpSession {
/**
* Create a new MockHttpSession with a default {@link MockServletContext}.
*
* @see MockServletContext
*/
public MockHttpSession() {
@@ -82,7 +81,6 @@ public class MockHttpSession implements HttpSession {
/**
* Create a new MockHttpSession.
*
* @param servletContext the ServletContext that the session runs in
*/
public MockHttpSession(ServletContext servletContext) {
@@ -91,7 +89,6 @@ public class MockHttpSession implements HttpSession {
/**
* Create a new MockHttpSession.
*
* @param servletContext the ServletContext that the session runs in
* @param id a unique identifier for this session
*/
@@ -100,6 +97,7 @@ public class MockHttpSession implements HttpSession {
this.id = (id != null ? id : Integer.toString(nextId++));
}
@Override
public long getCreationTime() {
assertIsValid();
@@ -112,8 +110,8 @@ public class MockHttpSession implements HttpSession {
}
/**
* As of Servlet 3.1 the id of a session can be changed.
* @return the new session id.
* As of Servlet 3.1, the id of a session can be changed.
* @return the new session id
* @since 4.0.3
*/
public String changeSessionId() {
@@ -228,7 +226,6 @@ public class MockHttpSession implements HttpSession {
/**
* Invalidates this session then unbinds any objects bound to it.
*
* @throws IllegalStateException if this method is called on an already invalidated session
*/
@Override
@@ -245,13 +242,10 @@ public class MockHttpSession implements HttpSession {
/**
* Convenience method for asserting that this session has not been
* {@linkplain #invalidate() invalidated}.
*
* @throws IllegalStateException if this session has been invalidated
*/
private void assertIsValid() {
if (isInvalid()) {
throw new IllegalStateException("The session has already been invalidated");
}
Assert.state(!isInvalid(), "The session has already been invalidated");
}
public void setNew(boolean value) {
@@ -267,7 +261,6 @@ public class MockHttpSession implements HttpSession {
/**
* Serialize the attributes of this session into an object that can be
* turned into a byte array with standard Java serialization.
*
* @return a representation of this session's serialized state
*/
public Serializable serializeState() {
@@ -294,7 +287,6 @@ public class MockHttpSession implements HttpSession {
/**
* Deserialize the attributes of this session from a state object created by
* {@link #serializeState()}.
*
* @param state a representation of this session's serialized state
*/
@SuppressWarnings("unchecked")