소스 검색

Move log statement

Moved after removeSessionInformation() is called for comprehensible output to log file. The log statements are now written in correct order. Before the change, this could be confusing when debugging an application, since it seemed that the registered session was immediately removed when only looking at the logs.
joos-edia 6 년 전
부모
커밋
0e7462272f
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      core/src/main/java/org/springframework/security/core/session/SessionRegistryImpl.java

+ 4 - 4
core/src/main/java/org/springframework/security/core/session/SessionRegistryImpl.java

@@ -120,15 +120,15 @@ public class SessionRegistryImpl implements SessionRegistry,
 		Assert.hasText(sessionId, "SessionId required as per interface contract");
 		Assert.notNull(principal, "Principal required as per interface contract");
 
+		if (getSessionInformation(sessionId) != null) {
+			removeSessionInformation(sessionId);
+		}
+
 		if (logger.isDebugEnabled()) {
 			logger.debug("Registering session " + sessionId + ", for principal "
 					+ principal);
 		}
 
-		if (getSessionInformation(sessionId) != null) {
-			removeSessionInformation(sessionId);
-		}
-
 		sessionIds.put(sessionId,
 				new SessionInformation(principal, sessionId, new Date()));