Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
cfc38df1
Commit
cfc38df1
authored
9 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1873: fix an issue with the ConcurrentHashMaps
parent
2965446a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/core/util/session/UserSessionManager.java
+10
-5
10 additions, 5 deletions
...n/java/org/olat/core/util/session/UserSessionManager.java
with
10 additions
and
5 deletions
src/main/java/org/olat/core/util/session/UserSessionManager.java
+
10
−
5
View file @
cfc38df1
...
@@ -23,6 +23,7 @@ import java.util.Comparator;
...
@@ -23,6 +23,7 @@ import java.util.Comparator;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
java.util.TreeSet
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
...
@@ -271,8 +272,9 @@ public class UserSessionManager implements GenericEventListener {
...
@@ -271,8 +272,9 @@ public class UserSessionManager implements GenericEventListener {
//SIDEEFFECT!! to signOffAndClear
//SIDEEFFECT!! to signOffAndClear
//if invalidatedSession is removed from authUserSessions
//if invalidatedSession is removed from authUserSessions
//signOffAndClear does not remove the identity.getName().toLowerCase() from the userNameToIdentity
//signOffAndClear does not remove the identity.getName().toLowerCase() from the userNameToIdentity
//
if
(
invalidatedSession
!=
null
)
{
authUserSessions
.
remove
(
invalidatedSession
);
authUserSessions
.
remove
(
invalidatedSession
);
}
}
}
authUserSessions
.
add
(
usess
);
authUserSessions
.
add
(
usess
);
// user can choose upercase letters in identity name, but this has no effect on the
// user can choose upercase letters in identity name, but this has no effect on the
...
@@ -430,7 +432,7 @@ public class UserSessionManager implements GenericEventListener {
...
@@ -430,7 +432,7 @@ public class UserSessionManager implements GenericEventListener {
//remove only from identityEnvironment if found in sessions.
//remove only from identityEnvironment if found in sessions.
//see also SIDEEFFECT!! line in signOn(..)
//see also SIDEEFFECT!! line in signOn(..)
Identity
previousSignedOn
=
identityEnvironment
.
getIdentity
();
Identity
previousSignedOn
=
identityEnvironment
.
getIdentity
();
if
(
previousSignedOn
!=
null
)
{
if
(
previousSignedOn
!=
null
&&
previousSignedOn
.
getKey
()
!=
null
)
{
if
(
isDebug
)
log
.
debug
(
"signOffAndClearWithout() removing from userNameToIdentity: "
+
previousSignedOn
.
getName
().
toLowerCase
());
if
(
isDebug
)
log
.
debug
(
"signOffAndClearWithout() removing from userNameToIdentity: "
+
previousSignedOn
.
getName
().
toLowerCase
());
userNameToIdentity
.
remove
(
previousSignedOn
.
getKey
());
userNameToIdentity
.
remove
(
previousSignedOn
.
getKey
());
userSessionCache
.
remove
(
previousSignedOn
.
getKey
());
userSessionCache
.
remove
(
previousSignedOn
.
getKey
());
...
@@ -459,6 +461,7 @@ public class UserSessionManager implements GenericEventListener {
...
@@ -459,6 +461,7 @@ public class UserSessionManager implements GenericEventListener {
* - WindowManager responsible to dispose controller chain
* - WindowManager responsible to dispose controller chain
* @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
* @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
*/
*/
@Override
public
void
event
(
Event
event
)
{
public
void
event
(
Event
event
)
{
if
(
event
instanceof
SignOnOffEvent
)
{
if
(
event
instanceof
SignOnOffEvent
)
{
SignOnOffEvent
se
=
(
SignOnOffEvent
)
event
;
SignOnOffEvent
se
=
(
SignOnOffEvent
)
event
;
...
@@ -592,7 +595,7 @@ public class UserSessionManager implements GenericEventListener {
...
@@ -592,7 +595,7 @@ public class UserSessionManager implements GenericEventListener {
UserSession
identitySession
=
null
;
UserSession
identitySession
=
null
;
if
(
identityKey
!=
null
)
{
if
(
identityKey
!=
null
)
{
//do not call from somewhere else then signOffAndClear!!
//do not call from somewhere else then signOffAndClear!!
identity
Session
=
authUserSessions
.
stream
().
filter
(
userSession
->
{
Optional
<
UserSession
>
optional
Session
=
authUserSessions
.
stream
().
filter
(
userSession
->
{
Identity
identity
=
userSession
.
getIdentity
();
Identity
identity
=
userSession
.
getIdentity
();
if
(
identity
!=
null
&&
identityKey
.
equals
(
identity
.
getKey
())
if
(
identity
!=
null
&&
identityKey
.
equals
(
identity
.
getKey
())
&&
userSession
.
getSessionInfo
()
!=
null
&&
userSession
.
getSessionInfo
()
!=
null
...
@@ -601,7 +604,9 @@ public class UserSessionManager implements GenericEventListener {
...
@@ -601,7 +604,9 @@ public class UserSessionManager implements GenericEventListener {
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}).
findFirst
().
get
();
}).
findFirst
();
identitySession
=
optionalSession
.
isPresent
()
?
optionalSession
.
get
()
:
null
;
}
}
return
identitySession
;
return
identitySession
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment