fix Session#finishInvalidate throwsConcurrentModificationException (#4036)

* fix Session#finishInvalidate throws java.util.ConcurrentModificationException
* Change constructor _attribute field must assigned to ConcurrentHashMap

Signed-off-by: tomoya-yokota <tomoya-yokota@cybozu.co.jp>
This commit is contained in:
tomoya yokota 2019-09-09 13:52:48 +09:00 committed by Jan Bartel
parent 5f83f0a599
commit c904a14d6a
1 changed files with 7 additions and 6 deletions

View File

@ -161,11 +161,6 @@ public class SessionData implements Serializable
}
public SessionData(String id, String cpath, String vhost, long created, long accessed, long lastAccessed, long maxInactiveMs)
{
this(id, cpath, vhost, created, accessed, lastAccessed, maxInactiveMs, new ConcurrentHashMap<String, Object>());
}
public SessionData(String id, String cpath, String vhost, long created, long accessed, long lastAccessed, long maxInactiveMs, Map<String, Object> attributes)
{
_id = id;
setContextPath(cpath);
@ -175,7 +170,13 @@ public class SessionData implements Serializable
_lastAccessed = lastAccessed;
_maxInactiveMs = maxInactiveMs;
calcAndSetExpiry();
_attributes = attributes;
_attributes = new ConcurrentHashMap<>();
}
public SessionData(String id, String cpath, String vhost, long created, long accessed, long lastAccessed, long maxInactiveMs, Map<String, Object> attributes)
{
this(id, cpath, vhost, created, accessed, lastAccessed, maxInactiveMs);
putAllAttributes(attributes);
}
/**