jcoleman/tomcat-redis-session-manager — Issue #2: RedisSession.java
Author: ssrini
Created: 2011-12-21 03:27:13+00:00
State: open

We were getting a Null pointer exception in SetAttribute(). THe current code is:

public void setAttribute(String key, Object value) {
Object oldValue = getAttribute(key);
if ( value == null && oldValue != null
|| oldValue != null && value == null
|| !value.getClass().isInstance(oldValue)
|| !value.equals(oldValue) ) {
changedAttributes.put(key, value);
}

Shouldn't this actually be
if ( value == null && oldValue != null
|| oldValue == null && value != null

Currently both conditions are the same. Please advise.