Fix for NoSuchMethodError: tomcat.request.session.redis.SessionManager.getContext()

pull/15/head
Ranjith Manickam 2017-10-20 15:53:51 +05:30
parent e35c8fdbf3
commit 5f11796f71
1 changed files with 3 additions and 6 deletions

View File

@ -204,8 +204,7 @@ public class SessionManager extends ManagerBase implements Lifecycle {
@Override
public Session findSession(String sessionId) throws IOException {
Session session = null;
if (sessionId != null && this.sessionContext.get() != null
&& sessionId.equals(this.sessionContext.get().getId())) {
if (sessionId != null && this.sessionContext.get() != null && sessionId.equals(this.sessionContext.get().getId())) {
session = this.sessionContext.get().getSession();
} else {
byte[] data = this.dataCache.get(sessionId);
@ -296,13 +295,11 @@ public class SessionManager extends ManagerBase implements Lifecycle {
Boolean isPersisted;
Session newSession = (Session) session;
byte[] hash = (this.sessionContext.get() != null && this.sessionContext.get().getMetadata() != null)
? this.sessionContext.get().getMetadata().getAttributesHash()
: null;
? this.sessionContext.get().getMetadata().getAttributesHash() : null;
byte[] currentHash = serializer.getSessionAttributesHashCode(newSession);
if (forceSave || newSession.isDirty()
|| (isPersisted = (this.sessionContext.get() != null) ? this.sessionContext.get().isPersisted()
: null) == null
|| (isPersisted = (this.sessionContext.get() != null) ? this.sessionContext.get().isPersisted() : null) == null
|| !isPersisted || !Arrays.equals(hash, currentHash)) {
SessionMetadata metadata = new SessionMetadata();