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
1d878c9d
Commit
1d878c9d
authored
12 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-582: synchronize the iterator of history list
parent
6d797c7b
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/UserSession.java
+14
-9
14 additions, 9 deletions
src/main/java/org/olat/core/util/UserSession.java
with
14 additions
and
9 deletions
src/main/java/org/olat/core/util/UserSession.java
+
14
−
9
View file @
1d878c9d
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
package
org.olat.core.util
;
package
org.olat.core.util
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
...
@@ -264,7 +265,7 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
...
@@ -264,7 +265,7 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
}
}
public
List
<
HistoryPoint
>
getHistoryStack
()
{
public
List
<
HistoryPoint
>
getHistoryStack
()
{
return
history
;
return
new
ArrayList
<
HistoryPoint
>(
history
)
;
}
}
public
HistoryPoint
getLastHistoryPoint
()
{
public
HistoryPoint
getLastHistoryPoint
()
{
...
@@ -294,10 +295,12 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
...
@@ -294,10 +295,12 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
String
uuid
=
ureq
.
getUuid
();
String
uuid
=
ureq
.
getUuid
();
if
(!
history
.
isEmpty
())
{
if
(!
history
.
isEmpty
())
{
//consolidate
//consolidate
for
(
Iterator
<
HistoryPoint
>
it
=
history
.
iterator
();
it
.
hasNext
();
)
{
synchronized
(
history
)
{
HistoryPoint
p
=
it
.
next
();
for
(
Iterator
<
HistoryPoint
>
it
=
history
.
iterator
();
it
.
hasNext
();
)
{
if
(
uuid
.
equals
(
p
.
getUuid
()))
{
HistoryPoint
p
=
it
.
next
();
it
.
remove
();
if
(
uuid
.
equals
(
p
.
getUuid
()))
{
it
.
remove
();
}
}
}
}
}
}
}
...
@@ -311,10 +314,12 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
...
@@ -311,10 +314,12 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
public
void
removeFromHistory
(
BusinessControl
businessControl
)
{
public
void
removeFromHistory
(
BusinessControl
businessControl
)
{
String
businessPath
=
businessControl
.
getAsString
();
String
businessPath
=
businessControl
.
getAsString
();
for
(
Iterator
<
HistoryPoint
>
it
=
history
.
iterator
();
it
.
hasNext
();
)
{
synchronized
(
history
)
{
String
path
=
it
.
next
().
getBusinessPath
();
for
(
Iterator
<
HistoryPoint
>
it
=
history
.
iterator
();
it
.
hasNext
();
)
{
if
(
path
.
startsWith
(
businessPath
))
{
String
path
=
it
.
next
().
getBusinessPath
();
it
.
remove
();
if
(
path
.
startsWith
(
businessPath
))
{
it
.
remove
();
}
}
}
}
}
}
}
...
...
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